X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftext.cpp;h=bd358032c65ff22d6f1cee3d83af64f5570e6909;hb=70e7a223a069874cda84673a4ca541aa44b12bf2;hp=a3ed762a2cd560754dcd973094e547d5977eae20;hpb=2aa99730d8c3106deeac1186e057055604835752;p=libs%2Fgltk.git diff --git a/source/text.cpp b/source/text.cpp index a3ed762..bd35803 100644 --- a/source/text.cpp +++ b/source/text.cpp @@ -25,7 +25,14 @@ struct Text::CoordsToGeomData Text::Text(): style(0) -{ } +{ + Line line; + line.start = 0; + line.bytes = 0; + line.length = 0; + line.width = 0; + lines.push_back(line); +} Text::Text(const Style &s, const string &t): style(&s) @@ -332,9 +339,9 @@ void Text::build_line(unsigned i, const Geometry &rgeom, RenderData &data) const { const Line &line = lines[i]; - GL::MatrixStack::Push _pushm(data.bld->matrix()); - data.bld->matrix() *= GL::Matrix::translation(rgeom.x, rgeom.y, 0); - data.bld->matrix() *= GL::Matrix::scaling(style->get_font_size()); + GL::VertexBuilder::PushMatrix _pushm(*data.bld); + data.bld->transform(GL::Matrix::translation(rgeom.x, rgeom.y, 0)); + data.bld->transform(GL::Matrix::scaling(style->get_font_size())); style->get_font().build_string(text.substr(line.start, line.bytes), *data.bld); }