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>
This commit is contained in:
Thiago Macieira 2011-07-12 17:08:35 +02:00 committed by Qt by Nokia
parent 1bedbb3706
commit a8fd5b9d2a

View 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);