diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-03-04 08:20:38 +0000 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-03-04 08:20:38 +0000 |
commit | 08b8750ce53d9c6800a09026912eb261de3a36e5 (patch) | |
tree | 8662ed396a610bbbe9b15bb4dd42531627f1e11f /src | |
parent | 58384a345ba0972074aa5b73a5e598763de92468 (diff) | |
download | space-plat-hs-08b8750ce53d9c6800a09026912eb261de3a36e5.tar.gz space-plat-hs-08b8750ce53d9c6800a09026912eb261de3a36e5.zip |
Fix rendering for vertical scroll
There's still the issue of not doing clipping on the top of the screen.
Diffstat (limited to 'src')
-rw-r--r-- | src/Game/Map.hs | 2 |
1 files changed, 1 insertions, 1 deletions
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. |