From d5cfdfffc8c63c6f1cceb46a9bcd5c555a7baa28 Mon Sep 17 00:00:00 2001 From: "junov@chromium.org" Date: Wed, 24 Apr 2013 15:39:11 +0000 Subject: Fixing numerical rounding edge case in SkTileGrid BUG=https://code.google.com/p/chromium/issues/detail?id=234688 TEST=TileGrid skia unit test Review URL: https://codereview.chromium.org/13860011 git-svn-id: http://skia.googlecode.com/svn/trunk@8839 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/core/SkTileGrid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/SkTileGrid.cpp b/src/core/SkTileGrid.cpp index 7a9c8eec6b..c39e21b356 100644 --- a/src/core/SkTileGrid.cpp +++ b/src/core/SkTileGrid.cpp @@ -81,9 +81,9 @@ void SkTileGrid::search(const SkIRect& query, SkTDArray* results) { fInfo.fTileInterval.height(); tileStartX = SkPin32(tileStartX, 0, fXTileCount - 1); - tileEndX = SkPin32(tileEndX, 1, fXTileCount); + tileEndX = SkPin32(tileEndX, tileStartX+1, fXTileCount); tileStartY = SkPin32(tileStartY, 0, fYTileCount - 1); - tileEndY = SkPin32(tileEndY, 1, fYTileCount); + tileEndY = SkPin32(tileEndY, tileStartY+1, fYTileCount); int queryTileCount = (tileEndX - tileStartX) * (tileEndY - tileStartY); SkASSERT(queryTileCount); -- cgit v1.2.3