out of bounds doesn't result in crappy zoom.

This commit is contained in:
2015-03-02 16:02:31 -08:00
parent 65436e747f
commit de27f437b9

View File

@@ -89,7 +89,7 @@
(defn pan-to [screen entities x y scale-fn & [ease duration]]
(let [ease (or ease tween/ease-in-out-quadratic)
duration (or duration 3.0)
target-zoom (min 0.95 (max 0.75 (scale-fn [x y])))
target-zoom (min 0.95 (max 0.75 (scale-fn [(max 0 (min 319 x)) (max 0 (min 240 y))])))
current-zoom (get-in entities [:cam :zoom] 1.0)
;; don't zoom if it's a subtle difference