From 5136eef4bc7c11e2af5ff218f2d9a8b3d6adb52a Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Tue, 28 Jun 2022 09:55:39 +0200 Subject: [PATCH 1/2] :sparkles: Update auth urls navigation --- frontend/src/app/main/ui/routes.cljs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/frontend/src/app/main/ui/routes.cljs b/frontend/src/app/main/ui/routes.cljs index a456f7bd4..3a2f87b3f 100644 --- a/frontend/src/app/main/ui/routes.cljs +++ b/frontend/src/app/main/ui/routes.cljs @@ -92,17 +92,23 @@ (defn on-navigate [router path] - (let [match (match-path router path) - profile (:profile @storage) - nopath? (or (= path "") (= path "/")) - authed? (and (not (nil? profile)) - (not= (:id profile) uuid/zero))] + (let [match (match-path router path) + profile (:profile @storage) + nopath? (or (= path "") (= path "/")) + path-name (-> match :data :name) + authpath? (some #(= path-name %) '(:auth-login + :auth-register + :auth-register-validate + :auth-register-success + :auth-recovery-request + :auth-recovery)) + authed? (and (not (nil? profile)) + (not= (:id profile) uuid/zero))] (cond - (and nopath? authed? (nil? match)) - (if (not= uuid/zero profile) - (st/emit! (rt/nav :dashboard-projects {:team-id (du/get-current-team-id profile)})) - (st/emit! (rt/nav :auth-login))) + (or (and nopath? authed? (nil? match)) + (and authpath? authed?)) + (st/emit! (rt/nav :dashboard-projects {:team-id (du/get-current-team-id profile)})) (and (not authed?) (nil? match)) (st/emit! (rt/nav :auth-login)) From a271a285ade505897553106623a5cdbb29fb7935 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 29 Jun 2022 08:22:50 +0200 Subject: [PATCH 2/2] :bug: Fix problem with resize groups --- CHANGES.md | 1 + .../src/app/common/geom/shapes/transforms.cljc | 18 ++++++++++-------- .../app/main/data/workspace/transforms.cljs | 6 +++--- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0e3d44df0..0a7037084 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ ### :bug: Bugs fixed - Fix fill information not complete when paste plain text [Taiga #3680](https://tree.taiga.io/project/penpot/issue/3680) +- Fix problem when resizing groups [Taiga #3702](https://tree.taiga.io/project/penpot/issue/3702) ## 1.14.1-beta diff --git a/common/src/app/common/geom/shapes/transforms.cljc b/common/src/app/common/geom/shapes/transforms.cljc index 6fd41c01a..e7a2ae2cf 100644 --- a/common/src/app/common/geom/shapes/transforms.cljc +++ b/common/src/app/common/geom/shapes/transforms.cljc @@ -524,15 +524,17 @@ (gmt/translate (gpt/negate center))))))) (defn- set-flip [shape modifiers] - (let [rx (or (get-in modifiers [:resize-vector :x]) - (get-in modifiers [:resize-vector-2 :x])) - ry (or (get-in modifiers [:resize-vector :y]) - (get-in modifiers [:resize-vector-2 :y]))] + (let [rv1x (or (get-in modifiers [:resize-vector :x]) 1) + rv1y (or (get-in modifiers [:resize-vector :y]) 1) + rv2x (or (get-in modifiers [:resize-vector-2 :x]) 1) + rv2y (or (get-in modifiers [:resize-vector-2 :y]) 1)] (cond-> shape - (and rx (< rx 0)) (-> (update :flip-x not) - (update :rotation -)) - (and ry (< ry 0)) (-> (update :flip-y not) - (update :rotation -))))) + (or (neg? rv1x) (neg? rv2x)) + (-> (update :flip-x not) + (update :rotation -)) + (or (neg? rv1y) (neg? rv2y)) + (-> (update :flip-y not) + (update :rotation -))))) (defn- apply-displacement [shape] (let [modifiers (:modifiers shape)] diff --git a/frontend/src/app/main/data/workspace/transforms.cljs b/frontend/src/app/main/data/workspace/transforms.cljs index 0ae4229f9..9ab913ff4 100644 --- a/frontend/src/app/main/data/workspace/transforms.cljs +++ b/frontend/src/app/main/data/workspace/transforms.cljs @@ -276,8 +276,7 @@ "Adjust modifiers so they adjust to the pixel grid" [modifiers shape] - (if (or (some? (:resize-transform modifiers)) - (some? (:resize-transform-2 modifiers))) + (if (some? (:resize-transform modifiers)) ;; If we're working with a rotation we don't handle pixel precision because ;; the transformation won't have the precision anyway modifiers @@ -290,7 +289,8 @@ (gsh/points->rect)) flip-x? (neg? (get-in modifiers [:resize-vector :x])) - flip-y? (neg? (get-in modifiers [:resize-vector :y])) + flip-y? (or (neg? (get-in modifiers [:resize-vector :y])) + (neg? (get-in modifiers [:resize-vector-2 :y]))) path? (= :path (:type shape)) vertical-line? (and path? (<= (:width raw-bounds) 0.01))