Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: src/core/SkNinePatchIter.cpp

Issue 1451183004: fix ninepatch iter from generating invalid rects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tidy Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkNinePatchIter.cpp
diff --git a/src/core/SkNinePatchIter.cpp b/src/core/SkNinePatchIter.cpp
index c6bd16dcdb6665bae4eed635c38e3ad79143e3f5..5d24d75e7a093af3eff432d88cff960f4f4682d6 100644
--- a/src/core/SkNinePatchIter.cpp
+++ b/src/core/SkNinePatchIter.cpp
@@ -56,15 +56,15 @@ bool SkNinePatchIter::next(SkRect* src, SkRect* dst) {
const int x = fCurrX;
const int y = fCurrY;
- SkASSERT(x >= 0 && x < 4);
- SkASSERT(y >= 0 && y < 4);
+ SkASSERT(x >= 0 && x < 3);
+ SkASSERT(y >= 0 && y < 3);
src->set(fSrcX[x], fSrcY[y], fSrcX[x + 1], fSrcY[y + 1]);
dst->set(fDstX[x], fDstY[y], fDstX[x + 1], fDstY[y + 1]);
- if (4 == ++fCurrX) {
+ if (3 == ++fCurrX) {
fCurrX = 0;
fCurrY += 1;
- if (fCurrY >= 4) {
+ if (fCurrY >= 3) {
fDone = true;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698