From f6134a6bd3802a8f6a5962da2a8710b3ae80b6c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Tue, 20 Jul 2021 09:19:24 +0200 Subject: [PATCH 1/2] :bug: Fix vertical resize when nested shapes --- common/src/app/common/geom/shapes/transforms.cljc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/src/app/common/geom/shapes/transforms.cljc b/common/src/app/common/geom/shapes/transforms.cljc index 0cf6fe842..63dc6baae 100644 --- a/common/src/app/common/geom/shapes/transforms.cljc +++ b/common/src/app/common/geom/shapes/transforms.cljc @@ -597,10 +597,8 @@ (assoc :resize-origin (:resize-origin parent-modifiers) :resize-vector (gpt/point (:x (:resize-vector parent-modifiers)) 1)) - (and (:resize-vector-2 parent-modifiers) - (not (mth/close? (:x (:resize-vector-2 parent-modifiers)) 1))) - (assoc :resize-origin-2 (:resize-origin-2 parent-modifiers) - :resize-vector-2 (gpt/point (:x (:resize-vector-2 parent-modifiers)) 1)) + ;; resize-vector-2 is always for vertical modifiers, so no need to + ;; check it here. (:displacement parent-modifiers) (assoc :displacement @@ -654,10 +652,12 @@ (assoc :resize-origin (:resize-origin parent-modifiers) :resize-vector (gpt/point 1 (:y (:resize-vector parent-modifiers)))) + ;; If there is a resize-vector-2, this means that we come from a recursive + ;; call, and the resize-vector has no vertical data, so we may override it. (and (:resize-vector-2 parent-modifiers) (not (mth/close? (:y (:resize-vector-2 parent-modifiers)) 1))) - (assoc :resize-origin-2 (:resize-origin-2 parent-modifiers) - :resize-vector-2 (gpt/point 1 (:y (:resize-vector-2 parent-modifiers)))) + (assoc :resize-origin (:resize-origin-2 parent-modifiers) + :resize-vector (gpt/point 1 (:y (:resize-vector-2 parent-modifiers)))) (:displacement parent-modifiers) (assoc :displacement From 578c561473ca52093bc070974843b9ce1f5ee96c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Tue, 20 Jul 2021 09:30:17 +0200 Subject: [PATCH 2/2] :bug: Fix linter issues --- backend/src/app/loggers/mattermost.clj | 2 +- common/src/app/common/pages/migrations.cljc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/app/loggers/mattermost.clj b/backend/src/app/loggers/mattermost.clj index fc0109bdd..f4a60e5c1 100644 --- a/backend/src/app/loggers/mattermost.clj +++ b/backend/src/app/loggers/mattermost.clj @@ -60,7 +60,7 @@ (a/close! output))) (defn- send-mattermost-notification! - [cfg {:keys [host version id] :as cdata}] + [cfg {:keys [host id] :as cdata}] (try (let [uri (:uri cfg) text (str "Unhandled exception (host: " host ", url: " (cfg/get :public-uri) "/dbg/error-by-id/" id "\n" diff --git a/common/src/app/common/pages/migrations.cljc b/common/src/app/common/pages/migrations.cljc index f06c79563..104e1fe4c 100644 --- a/common/src/app/common/pages/migrations.cljc +++ b/common/src/app/common/pages/migrations.cljc @@ -258,7 +258,7 @@ (defmethod migrate 11 [data] - (letfn [(update-object [objects id shape] + (letfn [(update-object [objects _id shape] (if (= :frame (:type shape)) (d/update-when shape :shapes (fn [shapes] (filterv (fn [id] (contains? objects id)) shapes)))