summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2017-11-24 17:27:59 -0500
committerFranklin Wei <git@fwei.tk>2017-11-24 20:31:45 -0500
commitd728b9775b0f9270d74408df86881a4d9d327df7 (patch)
tree291831a71ddcc8572c0752a93b1cfc44e780902f
parentf51544a0e545d30d4bd266fca10e1c3d3461794d (diff)
downloadrockbox-d728b97.tar.gz
rockbox-d728b97.zip
puzzles: fix off-by-one in blitter clipping
Nobody to blame except myself for this one... Change-Id: I8446b564c3c060411c46675e9baac1c72437c39a
-rw-r--r--apps/plugins/puzzles/rockbox.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c
index 1a399c48f9..733c4468ab 100644
--- a/apps/plugins/puzzles/rockbox.c
+++ b/apps/plugins/puzzles/rockbox.c
@@ -1164,10 +1164,10 @@ static void trim_rect(int *x, int *y, int *w, int *h)
int screenh = zoom_enabled ? zoom_h : LCD_HEIGHT;
/* Clip each coordinate at both extremes of the canvas */
- x0 = (x0 < 0 ? 0 : x0 > screenw - 1 ? screenw - 1: x0);
- x1 = (x1 < 0 ? 0 : x1 > screenw - 1 ? screenw - 1: x1);
- y0 = (y0 < 0 ? 0 : y0 > screenh - 1 ? screenh - 1: y0);
- y1 = (y1 < 0 ? 0 : y1 > screenh - 1 ? screenh - 1: y1);
+ x0 = (x0 < 0 ? 0 : x0 > screenw ? screenw: x0);
+ x1 = (x1 < 0 ? 0 : x1 > screenw ? screenw: x1);
+ y0 = (y0 < 0 ? 0 : y0 > screenh ? screenh: y0);
+ y1 = (y1 < 0 ? 0 : y1 > screenh ? screenh: y1);
/* Transform back into x,y,w,h to return */
*x = x0;