From a8fd5b9d2afea4e8eba271fb658668f15dfb09d7 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 12 Jul 2011 17:08:35 +0200 Subject: [PATCH] Fix uses of qRound on non-floating-point types. 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 Reviewed-on: http://codereview.qt.nokia.com/1541 Reviewed-by: Qt Sanity Bot --- src/gui/text/qfontengine_ft.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index dd30a150308..25c7268a9cb 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -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);