From dd17a0828e35620bc2ecb52f1ebac301906a0a68 Mon Sep 17 00:00:00 2001 From: Remington Covert Date: Sat, 20 Sep 2014 08:47:15 -0700 Subject: [PATCH] no weird scaling when switching screens --- desktop/src-common/advent/actions.clj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/desktop/src-common/advent/actions.clj b/desktop/src-common/advent/actions.clj index 02fc311d..919e9fea 100644 --- a/desktop/src-common/advent/actions.clj +++ b/desktop/src-common/advent/actions.clj @@ -182,12 +182,12 @@ entities)) (run-action entities (begin [this screen entities] - (let [ego (get-in entities [:background :entities :ego])] - (-> entities - (assoc-in [:background] (get-in entities [:backgrounds new-background])) - (assoc-in [:background :entities :ego] ego) - (assoc-in [:background :entities :ego :x] x) - (assoc-in [:background :entities :ego :y] y)))) + (let [ego (get-in entities [:background :entities :ego]) + entities (-> entities + (assoc-in [:background] (get-in entities [:backgrounds new-background])) + (assoc-in [:background :entities :ego] ego))] + (-> entities + (update-in [:background :entities :ego] #(jump-to screen entities % [x y]))))) (continue [this screen entities] (update-in entities [:transition :opacity] - 0.075))