Remove unnecessary image height adjustments from layout.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Mon, 20 Feb 2012 00:50:06 +0000 (10:50 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 20 Feb 2012 00:57:38 +0000 (01:57 +0100)
cb8445f0323b0eefbb04f1d8adad81a00b53abd8 removes an implied +1 from
document line height so we need to remove the compensating -1 from
image ascent/descent for image heights to be correct..

Change-Id: I310c06bcf1ce2eefef42c2828faa0eb435ad71cf
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
src/gui/text/qtextdocumentlayout.cpp

index cc3372d..2aedfe9 100644 (file)
@@ -3002,15 +3002,15 @@ void QTextDocumentLayout::resizeInlineObject(QTextInlineObject item, int posInDo
     {
     case QTextCharFormat::AlignMiddle:
         item.setDescent(inlineSize.height() / 2);
-        item.setAscent(inlineSize.height() / 2 - 1);
+        item.setAscent(inlineSize.height() / 2);
         break;
     case QTextCharFormat::AlignBaseline:
         item.setDescent(m.descent());
-        item.setAscent(inlineSize.height() - m.descent() - 1);
+        item.setAscent(inlineSize.height() - m.descent());
         break;
     default:
         item.setDescent(0);
-        item.setAscent(inlineSize.height() - 1);
+        item.setAscent(inlineSize.height());
     }
 }