From: nethack.allison Date: Thu, 14 Feb 2002 05:15:51 +0000 (+0000) Subject: From X-Git-Tag: MOVE2GIT~3176 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d18eb3f0d763c2d9aef5d1b32c7e38f842ae9fe;p=nethack From Fixed the map scrolling problem that Yitzhak reported. --- diff --git a/win/win32/mhmap.c b/win/win32/mhmap.c index c6f6e53c4..83e388a1d 100644 --- a/win/win32/mhmap.c +++ b/win/win32/mhmap.c @@ -112,7 +112,7 @@ void mswin_map_stretch(HWND hWnd, LPSIZE lpsz, BOOL redraw) GetNHApp()->bNoHScroll = TRUE; } else { GetNHApp()->bNoHScroll = FALSE; - data->xPos = max(0, min(COLNO, u.ux - data->xPageSize/2)); + data->xPos = max(0, min(COLNO-data->xPageSize+1, u.ux - data->xPageSize/2)); } si.cbSize = sizeof(si); @@ -134,7 +134,7 @@ void mswin_map_stretch(HWND hWnd, LPSIZE lpsz, BOOL redraw) GetNHApp()->bNoVScroll = TRUE; } else { GetNHApp()->bNoVScroll = FALSE; - data->yPos = max(0, min(ROWNO, u.uy - data->yPageSize/2)); + data->yPos = max(0, min(ROWNO-data->yPageSize+1, u.uy - data->yPageSize/2)); } si.cbSize = sizeof(si); @@ -670,8 +670,7 @@ void onMSNH_VScroll(HWND hWnd, WPARAM wParam, LPARAM lParam) yNewPos = data->yPos; } - yNewPos = max(0, yNewPos); - yNewPos = min(ROWNO-data->yPageSize+1, yNewPos); + yNewPos = max(0, min(ROWNO-data->yPageSize+1, yNewPos)); if( yNewPos == data->yPos ) return; yDelta = yNewPos - data->yPos; @@ -729,8 +728,7 @@ void onMSNH_HScroll(HWND hWnd, WPARAM wParam, LPARAM lParam) xNewPos = data->xPos; } - xNewPos = max(0, xNewPos); - xNewPos = min(COLNO-data->xPageSize+1, xNewPos); + xNewPos = max(0, min(COLNO-data->xPageSize+1, xNewPos)); if( xNewPos == data->xPos ) return; xDelta = xNewPos - data->xPos;