]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/dropdown.cpp
Return a reference from Style::get_font
[libs/gltk.git] / source / dropdown.cpp
index cff5387408a2b7551d308f014fcf91f7e1f674c5..cab6d918e536210190a256b67b7965c0851c2f1b 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgltk
-Copyright © 2007-2011  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include <msp/gl/font.h>
 #include "dropdown.h"
 #include "list.h"
@@ -38,9 +31,9 @@ void Dropdown::autosize()
        if(const Part *text_part = style->get_part("text"))
        {
                const Sides &margin = text_part->get_margin();
-               const GL::Font *font = style->get_font();
-               float font_size = font->get_default_size();
-               unsigned line_height = static_cast<unsigned>((font->get_ascent()-font->get_descent())*font_size);
+               const GL::Font &font = style->get_font();
+               float font_size = style->get_font_size();
+               unsigned line_height = static_cast<unsigned>((font.get_ascent()-font.get_descent())*font_size);
                geom.h = max(geom.h, line_height+margin.top+margin.bottom);
        }
 }