diff --git a/desktop/src-common/advent/screens/inventory.clj b/desktop/src-common/advent/screens/inventory.clj index 9bd98c11..2a26437c 100644 --- a/desktop/src-common/advent/screens/inventory.clj +++ b/desktop/src-common/advent/screens/inventory.clj @@ -59,8 +59,12 @@ :show-screen (fn [{items :items} [entities]] (assoc entities :start-showing? true :items (for [[item index] (map vector items (range)) - :let [x (+ (* 79 4) (* index (* 24 4))) - y (* 4 180) + :let [row (int (/ index 8)) + column (mod index 8) + base-x (* 79 4) + base-y (* 180 4) + x (+ base-x (* column (* 24 4))) + y (- base-y (* row (* 24 4))) item-width 16 offset-x (+ x (/ item-width 2)) offset-y (+ y (/ item-width 2))