summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Treat <adam.treat@qt.io>2018-02-09 07:39:10 -0500
committerAdam Treat <adam.treat@qt.io>2018-02-13 17:09:42 +0000
commitc8053565074b90fd383fef1f4b10aa23e7e09052 (patch)
tree9d7ac93d06378f08df2f497e54faa7d2b1fe59f3
parentaf9479f917bf5d21e35c2dffa59462a72db54f46 (diff)
Modify the previous fix by just setting the pixel size
This was recommended by Simon and I think it is a cleaner fix than the previous one. Change-Id: Ia3e16067559c6ee9e318352074cb4c258e38b859 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/Runtime/Source/Qt3DSRuntimeRender/Source/Qt3DSQtTextRenderer.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Runtime/Source/Qt3DSRuntimeRender/Source/Qt3DSQtTextRenderer.cpp b/src/Runtime/Source/Qt3DSRuntimeRender/Source/Qt3DSQtTextRenderer.cpp
index 3971007b..febc446e 100644
--- a/src/Runtime/Source/Qt3DSRuntimeRender/Source/Qt3DSQtTextRenderer.cpp
+++ b/src/Runtime/Source/Qt3DSRuntimeRender/Source/Qt3DSQtTextRenderer.cpp
@@ -399,10 +399,8 @@ struct Qt3DSQtTextRenderer : public ITextRenderer
void updateFontInfo(FontInfo &fi, const STextRenderInfo &inText,
QT3DSF32 inTextScaleFactor = 1.0f)
{
- static qreal dpi =
- QGuiApplication::primaryScreen()->logicalDotsPerInch();
- qreal point = inText.m_FontSize * 72 / dpi;
- fi.font.setPointSizeF(point * inTextScaleFactor);
+ qreal pixelSize = inText.m_FontSize;
+ fi.font.setPixelSize(pixelSize * inTextScaleFactor);
fi.font.setLetterSpacing(QFont::AbsoluteSpacing, qreal(inText.m_Tracking));
}