From e3c436d1bd3b952337e1456e56aa83a941c37576 Mon Sep 17 00:00:00 2001 From: barron1988 <120796547@qq.com> Date: Mon, 25 Nov 2024 19:08:42 +0800 Subject: [PATCH] Update blend2D text surround box --- pipeline/Drawer2D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipeline/Drawer2D.cpp b/pipeline/Drawer2D.cpp index a3ad362..c917d46 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.x0, bb.y1 - bb.y0 + yy); } return bbox; } -- Gitee