]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/table.cpp
Return a reference from Style::get_font
[libs/gltk.git] / source / table.cpp
index 67a93bc5bbaf0ccb1466350b90a006006e96c0e6..1fe69619f911aa892563c27b54dba76e613d1c5d 100644 (file)
@@ -56,7 +56,7 @@ void Table::render_special(const Part &part) const
 {
        if(part.get_name()=="cells")
        {
-               const GL::Font *const font = style->get_font();
+               const GL::Font &font = style->get_font();
                float font_size = style->get_font_size();
 
                unsigned free_width = geom.w;
@@ -81,15 +81,15 @@ void Table::render_special(const Part &part) const
                                Geometry rgeom;
                                rgeom.x = cgeom.x;
                                rgeom.y = cgeom.y;
-                               rgeom.w = static_cast<unsigned>(font->get_string_width(text)*font_size);
-                               rgeom.h = static_cast<unsigned>((font->get_ascent()-font->get_descent())*font_size);
+                               rgeom.w = static_cast<unsigned>(font.get_string_width(text)*font_size);
+                               rgeom.h = static_cast<unsigned>((font.get_ascent()-font.get_descent())*font_size);
 
                                part.get_alignment().apply(rgeom, cgeom, part.get_margin());
 
                                GL::push_matrix();
                                GL::translate(rgeom.x, rgeom.y, 0);
                                GL::scale_uniform(font_size);
-                               font->draw_string(text);
+                               font.draw_string(text);
                                GL::pop_matrix();
 
                                cgeom.x += cgeom.w;