diff options
-rw-r--r-- | src/runtimerender/Qt3DSDistanceFieldRenderer.cpp | 7 |
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 |