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>
This commit is contained in:
Mike Reed 2018-02-09 16:16:12 -05:00 committed by Skia Commit-Bot
parent c43611c02c
commit 0a5f99ccdf

View File

@ -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