Fix bug in grid alignment of fourty-one

This commit is contained in:
arne 2026-02-21 09:15:57 +01:00
commit 5937c7d14f

View file

@ -30,8 +30,8 @@
(defn as-grid [rect cell-size] (defn as-grid [rect cell-size]
(let [n-x (int (/ (g/width rect) cell-size)) (let [n-x (int (/ (g/width rect) cell-size))
n-y (int (/ (g/height rect) cell-size)) n-y (int (/ (g/height rect) cell-size))
t (v/vec2 (* (mod (g/width rect) n-x) 0.5) t (v/vec2 (* (mod (g/width rect) (* cell-size n-x)) 0.5)
(* (mod (g/height rect) n-x) 0.5))] (* (mod (g/height rect) (* cell-size n-x)) 0.5))]
(for [x (range n-x) (for [x (range n-x)
y (range n-y)] y (range n-y)]
(-> (r/rect (* x cell-size) (* y cell-size) cell-size) (-> (r/rect (* x cell-size) (* y cell-size) cell-size)