Chromium Code Reviews| Index: src/core/SkPath.cpp |
| diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp |
| index 9df62850fd2eb5bc9cf442dc4675b7091cded8c1..786d0936f4554fd32d2ab09c8434525d5c6b0cad 100644 |
| --- a/src/core/SkPath.cpp |
| +++ b/src/core/SkPath.cpp |
| @@ -2961,14 +2961,17 @@ static int winding_line(const SkPoint pts[], SkScalar x, SkScalar y) { |
| return dir; |
| } |
| +static bool contains_inclusive(const SkRect& r, SkScalar x, SkScalar y) { |
|
robertphillips
2013/10/30 17:18:48
shouldn't that be "<= r.fBottom"?
reed1
2013/10/30 17:38:53
doh! good catch. done.
|
| + return r.fLeft <= x && x <= r.fRight && r.fTop <= y && y < r.fBottom; |
| +} |
| + |
| bool SkPath::contains(SkScalar x, SkScalar y) const { |
| bool isInverse = this->isInverseFillType(); |
| if (this->isEmpty()) { |
| return isInverse; |
| } |
| - const SkRect& bounds = this->getBounds(); |
| - if (!bounds.contains(x, y)) { |
| + if (!contains_inclusive(this->getBounds(), x, y)) { |
| return isInverse; |
| } |