Commit 97b567ff authored by mjs's avatar mjs
Browse files

Reviewed by Adele.

        - fix build

        * platform/FloatRect.h:
        (WebCore::FloatRect::contains): Added; not exactly the same semantic as IntRect containment
        but more appropriate for path-type stuff.
        * platform/cg/PathCG.cpp:
        (WebCore::Path::contains): Don't use enclosingIntRect, just use FloatRect::contains.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e08cbe85
2006-09-30 Maciej Stachowiak <mjs@apple.com>
Reviewed by Adele.
- fix build
* platform/FloatRect.h:
(WebCore::FloatRect::contains): Added; not exactly the same semantic as IntRect containment
but more appropriate for path-type stuff.
* platform/cg/PathCG.cpp:
(WebCore::Path::contains): Don't use enclosingIntRect, just use FloatRect::contains.
2006-09-30 Alexey Proskuryakov <ap@nypop.com>
 
Reviewed by Darin.
......@@ -88,6 +88,13 @@ public:
void intersect(const FloatRect&);
void unite(const FloatRect&);
// Note, this doesn't match what IntRect::contains(IntPoint&) does; the int version
// is really checking for containment of 1x1 rect, but that doesn't make sense with floats.
bool contains(float px, float py) const
{ return px >= x() && px <= right() && py >= y() && py <= bottom(); }
bool contains(const FloatPoint& point) const { return contains(point.x(), point.y()); }
void inflateX(float dx) {
m_location.setX(m_location.x() - dx);
m_size.setWidth(m_size.width() + dx + dx);
......
......@@ -63,7 +63,7 @@ Path& Path::operator=(const Path& other)
bool Path::contains(const FloatPoint &point, WindRule rule) const
{
// CGPathContainsPoint returns false for non-closed paths, as a work-around, we copy and close the path first. Radar 4758998 asks for a better CG API to use
if (!enclosingIntRect(boundingRect()).contains(point.x(), point.y()))
if (!boundingRect().contains(point))
return false;
CGMutablePathRef path = CGPathCreateMutableCopy(m_path);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment