From 08b8750ce53d9c6800a09026912eb261de3a36e5 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sat, 4 Mar 2023 08:20:38 +0000 Subject: Fix rendering for vertical scroll There's still the issue of not doing clipping on the top of the screen. --- src/Game/Map.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Game/Map.hs') diff --git a/src/Game/Map.hs b/src/Game/Map.hs index 8445a1b..3fb72f9 100644 --- a/src/Game/Map.hs +++ b/src/Game/Map.hs @@ -189,7 +189,7 @@ viewport renderer (Map mapData _) vx vy vw vh offs = do newy = min (if fy + halfViewportHeight > mapHeight then mapHeight - vh else fy) (mapHeight - vh) (offsx, offsy) = fromMaybe (0, 0) offs - mapRect = U.rect (offsx - newx) (offsy - newy) (newx + vw) vh + mapRect = U.rect (offsx - newx) (offsy - newy) (newx + vw) (newy + vh) -- | Render a map. -- Requires a Viewport from viewport. -- cgit v1.2.3