From 11189af016c1deeefed476c5cc3a408f6ee79a2d Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 4 Feb 2014 09:07:43 +0100 Subject: Remove some left-over +1 in font height calculation In change cb8445f0323b0eefbb04f1d8adad81a00b53abd8, I tried to remove all the historical +1s when calculating the font height from the ascent and descent, but I missed a couple. These are used when drawing the background for the text, the height of which would no longer match the height returned from QFontMetrics. [ChangeLog][Text] Fixed off-by-one in the height of text background. Task-number: QTBUG-36444 Change-Id: If6d87f903e246f9faed2298bb1693b2556906eed Reviewed-by: Simon Hausmann --- src/gui/painting/qemulationpaintengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/painting/qemulationpaintengine.cpp') diff --git a/src/gui/painting/qemulationpaintengine.cpp b/src/gui/painting/qemulationpaintengine.cpp index bb87b4fd6e..0fb907b6c5 100644 --- a/src/gui/painting/qemulationpaintengine.cpp +++ b/src/gui/painting/qemulationpaintengine.cpp @@ -169,7 +169,7 @@ void QEmulationPaintEngine::drawTextItem(const QPointF &p, const QTextItem &text { if (state()->bgMode == Qt::OpaqueMode) { const QTextItemInt &ti = static_cast(textItem); - QRectF rect(p.x(), p.y() - ti.ascent.toReal(), ti.width.toReal(), (ti.ascent + ti.descent + 1).toReal()); + QRectF rect(p.x(), p.y() - ti.ascent.toReal(), ti.width.toReal(), (ti.ascent + ti.descent).toReal()); fillBGRect(rect); } -- cgit v1.2.3