diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2009-03-27 21:18:47 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-04-06 11:49:52 (GMT) |
commit | bc3d96a902d16a9bb358c05de9f6bfede3594731 (patch) | |
tree | c52c3c110d7ce8580a35e31b2dd557762111ff79 /src | |
parent | 30d01c387179160c8c418ecedfb4506a55d282e8 (diff) | |
download | Qt-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.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 2 |
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(); |