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>
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;
}