summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2009-03-27 21:18:47 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-04-06 11:49:52 (GMT)
commitbc3d96a902d16a9bb358c05de9f6bfede3594731 (patch)
treec52c3c110d7ce8580a35e31b2dd557762111ff79
parent30d01c387179160c8c418ecedfb4506a55d282e8 (diff)
downloadQt-bc3d96a902d16a9bb358c05de9f6bfede3594731.zip
Qt-bc3d96a902d16a9bb358c05de9f6bfede3594731.tar.gz
Qt-bc3d96a902d16a9bb358c05de9f6bfede3594731.tar.bz2
Optimise QPainterPath::contains(QPointF)
We can shortcut quite some calculations for the common case by first checking whether the point is contained in the control point rect.
-rw-r--r--src/gui/painting/qpainterpath.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index 70036e1..e1f5eea 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -1725,7 +1725,7 @@ static void qt_painterpath_isect_curve(const QBezier &bezier, const QPointF &pt,
*/
bool QPainterPath::contains(const QPointF &pt) const
{
- if (isEmpty())
+ if (isEmpty() || !controlPointRect().contains(pt))
return false;
QPainterPathData *d = d_func();