summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainterpath.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qpainterpath.cpp')
-rw-r--r--src/gui/painting/qpainterpath.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index e3c6eabbc3..e2f267d7ee 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -521,7 +521,7 @@ void QPainterPath::setElementPositionAt(int i, qreal x, qreal y)
/*!
Constructs an empty QPainterPath object.
*/
-QPainterPath::QPainterPath()
+QPainterPath::QPainterPath() Q_DECL_NOEXCEPT
: d_ptr(0)
{
}
@@ -3057,20 +3057,19 @@ qreal QPainterPath::slopeAtPercent(qreal t) const
//tangent line
qreal slope = 0;
-#define SIGN(x) ((x < 0)?-1:1)
if (m1)
slope = m2/m1;
else {
- //windows doesn't define INFINITY :(
-#ifdef INFINITY
- slope = INFINITY*SIGN(m2);
-#else
- if (sizeof(qreal) == sizeof(double)) {
- return 1.79769313486231570e+308;
+ if (std::numeric_limits<qreal>::has_infinity) {
+ slope = (m2 < 0) ? -std::numeric_limits<qreal>::infinity()
+ : std::numeric_limits<qreal>::infinity();
} else {
- return ((qreal)3.40282346638528860e+38);
+ if (sizeof(qreal) == sizeof(double)) {
+ return 1.79769313486231570e+308;
+ } else {
+ return ((qreal)3.40282346638528860e+38);
+ }
}
-#endif
}
return slope;