summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Korpipaa <tomi.korpipaa@qt.io>2021-10-07 09:01:38 +0300
committerTomi Korpipaa <tomi.korpipaa@qt.io>2021-10-08 17:47:51 +0300
commit427fddb50d43aa21a90fc7356ee3cdd8a908df56 (patch)
tree79b54696a525042122a350c198ca861bc0603e0f
parentc573413050ab1ff05007c82e3606b2650f7d47d7 (diff)
Take negative leading into account
Fixes: QT3DS-4231 Change-Id: Icd2d811c8926e09ce0a33861f7e7282514d8c5f8 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r--src/runtimerender/Qt3DSDistanceFieldRenderer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtimerender/Qt3DSDistanceFieldRenderer.cpp b/src/runtimerender/Qt3DSDistanceFieldRenderer.cpp
index 3986319..f673f2e 100644
--- a/src/runtimerender/Qt3DSDistanceFieldRenderer.cpp
+++ b/src/runtimerender/Qt3DSDistanceFieldRenderer.cpp
@@ -224,6 +224,13 @@ Q3DSDistanceFieldRenderer::buildGlyphsPerTexture(const SText &textInfo)
width = qMin(maximumWidth, qMax(width, textWidth));
height += layout.engine()->lines[line.lineNumber()].height().toReal();
+ // Windows seems to have leading taken into account already in descent, which is used
+ // to calculate height. Linux and Integrity do not, so we'll need to handle the
+ // negative leading here. On Windows the leading is not negative, as it has already
+ // been accounted for in the descent.
+ const QFixed leading = layout.engine()->lines[line.lineNumber()].leading;
+ if (leading < 0)
+ height += leading.toInt();
// Fast path for right elide
if (textInfo.m_Elide == TextElide::ElideRight