diff --git a/pipeline/Drawer2D.cpp b/pipeline/Drawer2D.cpp index a3ad36230bc5042651fd932c8cc1a7f0d6dad38e..0fbcc9e28a90dc82448cfa860909a9650874d83c 100644 --- a/pipeline/Drawer2D.cpp +++ b/pipeline/Drawer2D.cpp @@ -421,7 +421,7 @@ osg::Vec4 Drawer2D::getUtf8TextBoundingBox(const std::string& text, float size, BLGlyphBuffer gb; gb.setUtf8Text(text.data(), text.size()); BLTextMetrics tm; BLFontMetrics fm = font.metrics(); font.shape(gb); font.getTextMetrics(gb, tm); float xx = fm.ascent, yy = fm.lineGap + size; - const BLBox& bb = tm.boundingBox; bbox.set(bb.x0, bb.y0, bb.x1 - bb.x0 + xx, bb.y1 - bb.y0 + yy); + const BLBox& bb = tm.boundingBox; bbox.set(bb.x0, bb.y0 + fm.descent, bb.x1, bb.y1 - bb.y0 + yy); } return bbox; }