summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-12-14 14:54:44 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2009-12-15 12:38:19 (GMT)
commitac41c7da1e7da954e48ebdcefb1de53ce2911e75 (patch)
tree536cd8c068aba86138732830928bcacb1988723e /src/opengl/gl2paintengineex
parentaa5fb54778e66d0a93834de109b9d31d64f5f1ed (diff)
downloadQt-ac41c7da1e7da954e48ebdcefb1de53ce2911e75.zip
Qt-ac41c7da1e7da954e48ebdcefb1de53ce2911e75.tar.gz
Qt-ac41c7da1e7da954e48ebdcefb1de53ce2911e75.tar.bz2
Fixed QGL2PEXVertexArray to interpolate within the range [0, 1].
Because of numerical inaccuracy, the interpolation factor could exceed 1 by a small amount which would cause an assert failure.
Diffstat (limited to 'src/opengl/gl2paintengineex')
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
index ee1a797..b731a9f 100644
--- a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
+++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
@@ -145,7 +145,7 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc
// threshold based on same algorithm as in qtriangulatingstroker.cpp
int threshold = qMin<float>(64, qMax(bounds.width(), bounds.height()) * 3.14f / (curveInverseScale * 6));
if (threshold < 3) threshold = 3;
- qreal one_over_threshold_minus_1 = 1.f / (threshold - 1);
+ qreal one_over_threshold_minus_1 = qreal(1) / (threshold - 1);
for (int t=0; t<threshold; ++t) {
QPointF pt = b.pointAt(t * one_over_threshold_minus_1);
lineToArray(pt.x(), pt.y());