diff options
author | Ulf Hermann <[email protected]> | 2018-07-12 10:00:31 +0200 |
---|---|---|
committer | Simon Hausmann <[email protected]> | 2018-07-12 13:52:08 +0000 |
commit | 424cfef3cc3c140df51905713fa3849562bc494d (patch) | |
tree | e11680027eb11cc38769eb572161f86dc3164380 /src/quick/scenegraph/adaptations/software/qsgsoftwareglyphnode.cpp | |
parent | b98af3e0f3bfdc0187d7955683f90a7012a2d133 (diff) |
Quick: Use devicePixelRatioF rather than devicePixelRatio
The integer version of devicePixelRatio cannot handle fractional ratios
and will lead to arithmetic exceptions for ratios between 0 and 1.
Change-Id: I4a06a12742fa85e6d2f0e24193ae796dec7e2f15
Reviewed-by: Mitch Curtis <[email protected]>
Reviewed-by: Simon Hausmann <[email protected]>
Reviewed-by: Alessandro Portale <[email protected]>
Diffstat (limited to 'src/quick/scenegraph/adaptations/software/qsgsoftwareglyphnode.cpp')
-rw-r--r-- | src/quick/scenegraph/adaptations/software/qsgsoftwareglyphnode.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwareglyphnode.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwareglyphnode.cpp index 21f20c66cd..7ab9c15d9b 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwareglyphnode.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwareglyphnode.cpp @@ -91,8 +91,8 @@ void QSGSoftwareGlyphNode::paint(QPainter *painter) QPointF pos = m_position - QPointF(0, m_glyphRun.rawFont().ascent()); qreal offset = 1.0; - if (painter->device()->devicePixelRatio() != 0) - offset = 1.0 / painter->device()->devicePixelRatio(); + if (painter->device()->devicePixelRatioF() > 0.0) + offset = 1.0 / painter->device()->devicePixelRatioF(); switch (m_style) { case QQuickText::Normal: break; |