X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftext.cpp;h=b408bbe1780040cef29e600d2dab1b504b2d41b8;hb=bec07999d95b76f4b47cffcc564d0cd0afc0435e;hp=f791c3b269632e1ed2113554d8095f55182102c2;hpb=fa658c8500fb0c368a8299bd1210688640b50352;p=libs%2Fgl.git diff --git a/source/text.cpp b/source/text.cpp index f791c3b2..b408bbe1 100644 --- a/source/text.cpp +++ b/source/text.cpp @@ -11,7 +11,8 @@ Text::Text(const Font &f, const Technique *tech): font(f), mesh((TEXCOORD2, VERTEX2)), horz_align(0.0f), - vert_offset(0.0f) + vert_offset(0.0f), + width(0.0f) { object.set_mesh(&mesh); if(tech) @@ -35,7 +36,7 @@ void Text::set_text(const string &text, StringCodec::Decoder &dec) clear(); width = font.get_string_width(text, dec); MeshBuilder bld(mesh); - bld.matrix() *= Matrix::translation(Vector3(-horz_align*width, vert_offset, 0.0f)); + bld.transform(Matrix::translation(Vector3(-horz_align*width, vert_offset, 0.0f))); font.build_string(text, dec, bld); }