diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2016-06-09 14:03:22 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2016-06-14 08:35:38 +0000 |
commit | fe97ecf408da60931fc49b502a223d59b5f93f99 (patch) | |
tree | 9fdb566a28e14289aaf7642d9bcea7c2483d2f49 /src | |
parent | 23173c725ce8b1c5b03498c9fa2bb334d40ec6f4 (diff) |
Make it possible to create distance fields with any height
Assuming a certain max height for glyphs would make it impossible
to render certain fonts. The follow up to this change is in
Qt Quick, where the code must also be adapted to make it work.
Task-number: QTBUG-52389
Change-Id: Iabebb2de21a92d1537b2965aa6603529c1d5d587
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qdistancefield.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/text/qdistancefield.cpp b/src/gui/text/qdistancefield.cpp index 6a7019bc3c..c493ca1dad 100644 --- a/src/gui/text/qdistancefield.cpp +++ b/src/gui/text/qdistancefield.cpp @@ -799,8 +799,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, |