make sure there's an odd number of tiles
This commit is contained in:
parent
ddeba99f2e
commit
365c558f35
1 changed files with 6 additions and 2 deletions
|
|
@ -54,9 +54,13 @@ let init () =
|
||||||
C2d.fill_rect context ~x:0. ~y:0. ~w:(float_of_int width)
|
C2d.fill_rect context ~x:0. ~y:0. ~w:(float_of_int width)
|
||||||
~h:(float_of_int height)
|
~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
|
let orig_x = (width - (tiles_per_w * tile_size)) / 2
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue