diff options
author | Thiago Macieira <thiago@kde.org> | 2011-07-12 17:08:35 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-12 19:59:36 +0200 |
commit | a8fd5b9d2afea4e8eba271fb658668f15dfb09d7 (patch) | |
tree | ed4c5b44c97a54e0753b43be0892fca2b77c5e37 /src | |
parent | 1bedbb3706e9b0427c019d5dedbefd3984517f33 (diff) |
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 <olivier.goffart@nokia.com>
Reviewed-on: http://codereview.qt.nokia.com/1541
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qfontengine_ft.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index dd30a15030..25c7268a9c 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); |