summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2012-09-04 16:18:45 +0200
committerQt by Nokia <qt-info@nokia.com>2012-09-10 11:00:39 +0200
commita949d4ef8f1366e216df88915377516f47d4120c (patch)
treee3e4385065dd083c53b96079dade9caacda01080 /src
parent5243999c3cce91cb67ae11b7de445d5e955731b1 (diff)
Fix rounding error when drawing scaled text on OS X
This especially affected the print preview dialog, where certain characters would be grossly mispositioned. Task-number: QTBUG-27131 Change-Id: I385474a6f609a8f4291988206c7e63a0747673dd Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 92eaebb7b9..6003ccbd82 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -440,12 +440,12 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
glyph_metrics_t br = boundingBox(glyph);
if (m.isScaling()) {
- QFixed hscale = QFixed::fromReal(m.m11());
- QFixed vscale = QFixed::fromReal(m.m22());
- br.width *= hscale;
- br.height *= vscale;
- br.x *= hscale;
- br.y *= vscale;
+ qreal hscale = m.m11();
+ qreal vscale = m.m22();
+ br.width = QFixed::fromReal(br.width.toReal() * hscale);
+ br.height = QFixed::fromReal(br.height.toReal() * vscale);
+ br.x = QFixed::fromReal(br.x.toReal() * hscale);
+ br.y = QFixed::fromReal(br.y.toReal() * vscale);
}
QImage im(qRound(br.width)+2, qRound(br.height)+2, QImage::Format_RGB32);