Fix uses of qRound on non-floating-point types.
authorThiago Macieira <thiago@kde.org>
Tue, 12 Jul 2011 15:08:35 +0000 (17:08 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 12 Jul 2011 17:59:36 +0000 (19:59 +0200)
It's silly to round integeres, since they are already round. At most,
this would waste CPU cycles without any benefit.

Change-Id: I6fc0152f4416d723b65966e5d48cc7a07957b83c
Merge-request: 17
Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
Reviewed-on: http://codereview.qt.nokia.com/1541
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
src/gui/text/qfontengine_ft.cpp

index dd30a15..25c7268 100644 (file)
@@ -1644,7 +1644,7 @@ glyph_metrics_t QFontEngineFT::boundingBox(const QGlyphLayout &glyphs)
             overall.y = qMin(overall.y, y);
             xmax = qMax(xmax, x + g->width);
             ymax = qMax(ymax, y + g->height);
-            overall.xoff += qRound(g->advance);
+            overall.xoff += g->advance;
         } else {
             int left  = FLOOR(face->glyph->metrics.horiBearingX);
             int right = CEIL(face->glyph->metrics.horiBearingX + face->glyph->metrics.width);
@@ -1657,7 +1657,7 @@ glyph_metrics_t QFontEngineFT::boundingBox(const QGlyphLayout &glyphs)
             overall.y = qMin(overall.y, y);
             xmax = qMax(xmax, x + TRUNC(right - left));
             ymax = qMax(ymax, y + TRUNC(top - bottom));
-            overall.xoff += qRound(TRUNC(ROUND(face->glyph->advance.x)));
+            overall.xoff += int(TRUNC(ROUND(face->glyph->advance.x)));
         }
     }
     overall.height = qMax(overall.height, ymax - overall.y);