FontEngine[directwrite]: include leftBearing for boundingBox for glyphs

It was always 0

Task-number: QTBUG-113679
Pick-to: 6.6
Change-Id: I090036296ad2df99b986400863b1e57a5d6101fb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
bb10
Mårten Nordheim 2023-06-13 13:29:08 +02:00
parent 8469b36928
commit 1fcbe0f6c2
1 changed files with 3 additions and 1 deletions

View File

@ -586,7 +586,9 @@ glyph_metrics_t QWindowsFontEngineDirectWrite::boundingBox(const QGlyphLayout &g
for (int i = 0; i < glyphs.numGlyphs; ++i)
w += glyphs.effectiveAdvance(i);
return glyph_metrics_t(0, -ascent(), w - lastRightBearing(glyphs), ascent() + descent(), w, 0);
const QFixed leftBearing = firstLeftBearing(glyphs);
return glyph_metrics_t(leftBearing, -ascent(), w - leftBearing - lastRightBearing(glyphs),
ascent() + descent(), w, 0);
}
glyph_metrics_t QWindowsFontEngineDirectWrite::boundingBox(glyph_t g)