diff options
author | Liang Qi <liang.qi@qt.io> | 2016-06-20 07:54:09 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-06-20 07:54:09 +0000 |
commit | 5f0ec7305e4310123ddeb98d3523087e3c560d9c (patch) | |
tree | fbcad900b0b604a1005320c5015723c343807974 /src/gui/text/qdistancefield.cpp | |
parent | 683c30074e4b7c9048e9970de1851e5d9a6deeb4 (diff) | |
parent | e32f1a4d61f0c55d066a43657ad607131be8ca34 (diff) |
Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7
Diffstat (limited to 'src/gui/text/qdistancefield.cpp')
-rw-r--r-- | src/gui/text/qdistancefield.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/text/qdistancefield.cpp b/src/gui/text/qdistancefield.cpp index d90134482d..5a696807b4 100644 --- a/src/gui/text/qdistancefield.cpp +++ b/src/gui/text/qdistancefield.cpp @@ -550,7 +550,9 @@ static void makeDistanceField(QDistanceFieldData *data, const QPainterPath &path QPoint n(to.y() - from.y(), from.x() - to.x()); if (n.x() == 0 && n.y() == 0) continue; - int scale = qRound((offs << 16) / qSqrt(qreal(n.x() * n.x() + n.y() * n.y()))); // 8:16 + int scale = qRound((offs << 16) / qSqrt(qreal(n.x()) * n.x() + qreal(n.y()) * n.y())); // 8:16 + Q_ASSERT(scale != 0); + n.rx() = n.x() * scale >> 8; n.ry() = n.y() * scale >> 8; normals.append(n); @@ -805,8 +807,9 @@ QDistanceFieldData *QDistanceFieldData::create(const QPainterPath &path, bool do { int dfMargin = QT_DISTANCEFIELD_RADIUS(doubleResolution) / QT_DISTANCEFIELD_SCALE(doubleResolution); int glyphWidth = qCeil(path.boundingRect().width() / QT_DISTANCEFIELD_SCALE(doubleResolution)) + dfMargin * 2; + int glyphHeight = qCeil(path.boundingRect().height() / QT_DISTANCEFIELD_SCALE(doubleResolution)) + dfMargin * 2; - QDistanceFieldData *data = create(QSize(glyphWidth, QT_DISTANCEFIELD_TILESIZE(doubleResolution))); + QDistanceFieldData *data = create(QSize(glyphWidth, glyphHeight)); makeDistanceField(data, path, |