]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/list.cpp
Jump 10 steps when slider trough is clicked
[libs/gltk.git] / source / list.cpp
index 04adb399cc2adf237b3384384ac807ea5b6b5ff3..924cfb55d37b68f99e2091c844db7e91aafd6b90 100644 (file)
@@ -108,7 +108,7 @@ void List::button_press(int x, int y, unsigned btn)
        else if(btn==1)
        {
                const GL::Font *const font=style->get_font();
-               const unsigned row_height=static_cast<unsigned>(font->get_default_size());
+               const unsigned row_height=static_cast<unsigned>((font->get_ascent()-font->get_descent())*font->get_default_size());
 
                if(items_part)
                        y+=items_part->get_margin().top;
@@ -149,7 +149,7 @@ void List::render_special(const Part &part) const
                const GL::Font *const font=style->get_font();
                const float font_size=font->get_default_size();
                const GL::Color &color=style->get_font_color();
-               const unsigned row_height=static_cast<unsigned>(font_size);
+               const unsigned row_height=static_cast<unsigned>((font->get_ascent()-font->get_descent())*font_size);
                const Sides &margin=part.get_margin();
 
                Geometry pgeom=geom;
@@ -180,7 +180,7 @@ void List::render_special(const Part &part) const
                {
                        const GL::Font *const font=style->get_font();
                        const float font_size=font->get_default_size();
-                       const unsigned row_height=static_cast<unsigned>(font_size);
+                       const unsigned row_height=static_cast<unsigned>((font->get_ascent()-font->get_descent())*font_size);
                        const Sides &margin=part.get_margin();
 
                        Geometry pgeom=geom;