[BugFix] scroll_stop_viewport_rect off by 1

when you do the math yes there are 8 slots
between y = 16 and h = 8 and y = 24
16 17 18 19 20 21 22 23
1  2  3  4  5  6  7  8
but 16 + 8 = 24
ah an off by 1 error

Change-Id: I7b0625da1351910b27e5526c0a9f969c067758c6
This commit is contained in:
William Wilgus 2023-12-01 02:06:51 -05:00 committed by William Wilgus
parent 857267e9df
commit 8347203dc6

View file

@ -64,8 +64,8 @@ void LCDFN(scroll_stop_viewport_rect)(const struct viewport *vp, int x, int y, i
struct scrollinfo *s = &LCDFN(scroll_info).scroll[i]; struct scrollinfo *s = &LCDFN(scroll_info).scroll[i];
/* check if the specified area crosses the viewport in some way */ /* check if the specified area crosses the viewport in some way */
if (s->vp == vp if (s->vp == vp
&& (x < (s->x+s->width) && (x+width) >= s->x) && (x < (s->x+s->width) && (x+width) > s->x)
&& (y < (s->y+s->height) && (y+height) >= s->y)) && (y < (s->y+s->height) && (y+height) > s->y))
{ {
/* inform scroller about end of scrolling */ /* inform scroller about end of scrolling */
s->line = NULL; s->line = NULL;