diff --git a/ubb-la/gui.c b/ubb-la/gui.c index dc6e2a4..0743e97 100644 --- a/ubb-la/gui.c +++ b/ubb-la/gui.c @@ -177,6 +177,7 @@ static void show_map(int skip, int nibbles, int s0, int s1) int w = nibbles-skip; int m = (nibbles+skip) >> 1; int scale = 0; + int x0, x1; while (w >= XWIDTH/2) { w >>= 1; @@ -184,8 +185,9 @@ static void show_map(int skip, int nibbles, int s0, int s1) } boxColor(surf, XCENTER-(w >> 1), MAP_BUF_Y0, XCENTER+(w >> 1), MAP_BUF_Y1, MAP_BUF_RGBA); - rectangleColor(surf, (s0-m+(XCENTER << scale)) >> scale, MAP_VIEW_Y0, - (s1-m+(XCENTER << scale)) >> scale, MAP_VIEW_Y1, MAP_VIEW_RGBA); + x0 = (s0-m+(XCENTER << scale)) >> scale; + x1 = x0+((s1-s0) >> scale); + rectangleColor(surf, x0, MAP_VIEW_Y0, x1, MAP_VIEW_Y1, MAP_VIEW_RGBA); }