From be1515daac2e154378f5f75c4215d4a01593291a Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 1 Nov 2012 20:18:57 -0300 Subject: [PATCH] tools/ant-gui/ant-gui.c (gui): fix scrolling --- tools/ant-gui/ant-gui.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ant-gui/ant-gui.c b/tools/ant-gui/ant-gui.c index e9df3b7..d8f4754 100644 --- a/tools/ant-gui/ant-gui.c +++ b/tools/ant-gui/ant-gui.c @@ -131,12 +131,12 @@ static void gui(uint8_t *const *imgs, int n) SDL_FillRect(surf, NULL, SDL_MapRGB(surf->format, 0, 0, 0)); for (iy = 0; iy != NY; iy++) for (ix = 0; ix != NX; ix++) { - i = iy*NX+ix; + i = (y_top+iy)*NX+ix; if (i >= n) break; render(surf, imgs[i], - ix*(W+GAP), (iy-y_top)*(H+GAP), - ix == x && iy == y, i == active); + ix*(W+GAP), iy*(H+GAP), + ix == x && y_top+iy == y, i == active); } SDL_UnlockSurface(surf); SDL_UpdateRect(surf, 0, 0, 0, 0);