Calculate correct bounding rect for glyph runs in QTextLayout
The positions returned by getGlyphPositions() in QFontEngine are for the base line of the glyphs. We offset this by -ascent to get the top of the actual bounding rect. Task-number: QTBUG-22919 Change-Id: Id82c66ecfbdf58064f5ad26f4193fa55ac26bc7c Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
This commit is contained in:
parent
967e9d6e28
commit
d354f7d514
@ -2170,7 +2170,8 @@ static QGlyphRun glyphRunWithInfo(QFontEngine *fontEngine, const QGlyphLayout &g
|
||||
glyphRun.setFlags(flags);
|
||||
glyphRun.setRawFont(font);
|
||||
|
||||
glyphRun.setBoundingRect(QRectF(selectionX.toReal(), minY, selectionWidth.toReal(), height));
|
||||
glyphRun.setBoundingRect(QRectF(selectionX.toReal(), minY - font.ascent(),
|
||||
selectionWidth.toReal(), height));
|
||||
|
||||
return glyphRun;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user