summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qrasterizer.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp
index 921d260320..5a63840c03 100644
--- a/src/gui/painting/qrasterizer.cpp
+++ b/src/gui/painting/qrasterizer.cpp
@@ -725,10 +725,17 @@ static inline qreal qSafeDivide(qreal x, qreal y)
static inline QScFixed qSafeFloatToQScFixed(qreal x)
{
qreal tmp = x * QScFixedFactor;
- if (tmp > qreal(std::numeric_limits<QScFixed>::max()))
- return std::numeric_limits<QScFixed>::max();
- else if (tmp < qreal(std::numeric_limits<QScFixed>::min()))
- return std::numeric_limits<QScFixed>::min();
+#if Q_PROCESSOR_WORDSIZE == 8
+ if (tmp > qreal(INT_MAX) * QScFixedFactor)
+ return QScFixed(INT_MAX) * QScFixedFactor;
+ else if (tmp < qreal(INT_MIN) * QScFixedFactor)
+ return QScFixed(INT_MIN) * QScFixedFactor;
+#else
+ if (tmp > qreal(INT_MAX))
+ return INT_MAX;
+ else if (tmp < qreal(INT_MIN))
+ return -INT_MAX;
+#endif
return QScFixed(tmp);
}