diff options
author | Mike Reed <reed@google.com> | 2018-02-09 16:16:12 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-10 02:37:31 +0000 |
commit | 0a5f99ccdfa6743e83a3c4a8952548fb07907a00 (patch) | |
tree | 9bcba9930f34943da8b21a1546ea86ae9e4935af /include/core/SkRect.h | |
parent | c43611c02cd9f35148deeb057c033fa656b9b7ad (diff) |
can't cheat on contains due to underflow
Bug: skia:
Change-Id: Ic7fc4e1b843f885a2d52cd54861679f6c500eff4
Reviewed-on: https://skia-review.googlesource.com/106267
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include/core/SkRect.h')
-rw-r--r-- | include/core/SkRect.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/core/SkRect.h b/include/core/SkRect.h index 0153d8ceb6..5673980d49 100644 --- a/include/core/SkRect.h +++ b/include/core/SkRect.h @@ -456,8 +456,7 @@ struct SK_API SkIRect { @return true if (x, y) is inside SkIRect */ bool contains(int32_t x, int32_t y) const { - return (unsigned)(x - fLeft) < (unsigned)(fRight - fLeft) && - (unsigned)(y - fTop) < (unsigned)(fBottom - fTop); + return x >= fLeft && x < fRight && y >= fTop && y < fBottom; } /** Constructs SkRect to intersect from (left, top, right, bottom). Does not sort |