diff --git a/desktop/src-common/advent/screens/rooms.clj b/desktop/src-common/advent/screens/rooms.clj index 535513f4..21d7eef9 100644 --- a/desktop/src-common/advent/screens/rooms.clj +++ b/desktop/src-common/advent/screens/rooms.clj @@ -13,19 +13,24 @@ :mouse-in? (fn [entities x y] (let [e (utils/get-entity entities id)] (if-let [[bx1 by1 bx2 by2] (:box e)] - (zone/within bx1 by1 bx2 by2 x y) + (do (println "checking 1" id) + (zone/within bx1 by1 bx2 by2 x y)) (let [{^float entity-x :x ^float entity-y :y width :width scale-x :scale-x scale-y :scale-y origin-x :origin-x origin-y :origin-y height :height region :object} (-> entities :room :entities id) width (or width (if (instance? TextureRegion region ) (.getRegionWidth ^TextureRegion region) 0)) height (or height (if (instance? TextureRegion region ) (.getRegionHeight ^TextureRegion region) 0)) - entity-x (double (unchecked-add (float entity-x) (unchecked-multiply (float (or origin-x 0)) - (float (or scale-x 1))))) - entity-y (double (unchecked-add (float entity-y) (unchecked-multiply (float (or origin-y 0)) - (float (or scale-y 1)))))] + entity-x (double (unchecked-add (float entity-x) (unchecked-multiply (float -1.0) + (unchecked-multiply (float (or origin-x 0)) + (float (or scale-x 1)))))) + entity-y (double (unchecked-add (float entity-y) (unchecked-multiply + (float -1.0) + (unchecked-multiply (float (or origin-y 0)) + (float (or scale-y 1))))))] (zone/within entity-x entity-y (unchecked-add (float entity-x) (unchecked-multiply (float width) (float (or scale-x 1)))) - (unchecked-add (float entity-y) (unchecked-multiply (float height) (float (or scale-y 1)))) x y)))))} + (unchecked-add (float entity-y) (unchecked-multiply (float height) (float (or scale-y 1)))) + x y)))))} (when (or script scripts only-script) {:get-script (fn [cursor [x y]] (cond only-script