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); } diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index fbb4c2eb56..2944130eaa 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -6353,7 +6353,7 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText QTextItemInt &ti = const_cast(static_cast(_ti)); if (!extended && state->bgMode == Qt::OpaqueMode) { - 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()); q->fillRect(rect, state->bgBrush); }