forked from zapashcanon/pellest
make sure there's an odd number of tiles
This commit is contained in:
parent
ddeba99f2e
commit
365c558f35
@ -54,9 +54,13 @@ let init () =
|
||||
C2d.fill_rect context ~x:0. ~y:0. ~w:(float_of_int width)
|
||||
~h:(float_of_int height)
|
||||
|
||||
let tiles_per_w = width / tile_size
|
||||
let tiles_per_w =
|
||||
let n = width / tile_size in
|
||||
if n mod 2 = 0 then n - 1 else n
|
||||
|
||||
let tiles_per_h = height / tile_size
|
||||
let tiles_per_h =
|
||||
let n = height / tile_size in
|
||||
if n mod 2 = 0 then n - 1 else n
|
||||
|
||||
let orig_x = (width - (tiles_per_w * tile_size)) / 2
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user