diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-14 23:11:26 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-14 23:11:26 (GMT) |
commit | 1f6af025927bbba757ec78d85c3f2a179eff68b8 (patch) | |
tree | be106d4f98f58308a66a26ce21f22b2fef8e5516 /src/gui | |
parent | b1494900fd45c38e8c21f30311a642981c0fd795 (diff) | |
parent | c30714122c58a3dc6fd8401427da60c4afc4127b (diff) | |
download | Qt-1f6af025927bbba757ec78d85c3f2a179eff68b8.zip Qt-1f6af025927bbba757ec78d85c3f2a179eff68b8.tar.gz Qt-1f6af025927bbba757ec78d85c3f2a179eff68b8.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Prevented infinite recursion in QPainterPath::contains().
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index 9ef6955..0948a64 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -1690,7 +1690,7 @@ static void qt_painterpath_isect_line(const QPointF &p1, } static void qt_painterpath_isect_curve(const QBezier &bezier, const QPointF &pt, - int *winding) + int *winding, int depth = 0) { qreal y = pt.y(); qreal x = pt.x(); @@ -1705,7 +1705,7 @@ static void qt_painterpath_isect_curve(const QBezier &bezier, const QPointF &pt, // hit lower limit... This is a rough threshold, but its a // tradeoff between speed and precision. const qreal lower_bound = qreal(.001); - if (bounds.width() < lower_bound && bounds.height() < lower_bound) { + if (depth == 32 || (bounds.width() < lower_bound && bounds.height() < lower_bound)) { // We make the assumption here that the curve starts to // approximate a line after while (i.e. that it doesn't // change direction drastically during its slope) @@ -1718,8 +1718,8 @@ static void qt_painterpath_isect_curve(const QBezier &bezier, const QPointF &pt, // split curve and try again... QBezier first_half, second_half; bezier.split(&first_half, &second_half); - qt_painterpath_isect_curve(first_half, pt, winding); - qt_painterpath_isect_curve(second_half, pt, winding); + qt_painterpath_isect_curve(first_half, pt, winding, depth + 1); + qt_painterpath_isect_curve(second_half, pt, winding, depth + 1); } } |