From 5fd72cf9d904df0cc174b26a6b3eeaf922a6e968 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 3 Apr 2024 10:27:48 +0200 Subject: [PATCH] :bug: Fix problem with flip properties --- common/src/app/common/geom/shapes/transforms.cljc | 12 ++++++++---- common/src/app/common/types/shape.cljc | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/common/src/app/common/geom/shapes/transforms.cljc b/common/src/app/common/geom/shapes/transforms.cljc index e5eae48eb..ebde6bf80 100644 --- a/common/src/app/common/geom/shapes/transforms.cljc +++ b/common/src/app/common/geom/shapes/transforms.cljc @@ -299,12 +299,16 @@ (cond-> shape (neg? dot-x) - (-> (cr/update! :flip-x not) - (cr/update! :rotation -)) + (cr/update! :flip-x not) + + (neg? dot-x) + (cr/update! :rotation -) (neg? dot-y) - (-> (cr/update! :flip-y not) - (cr/update! :rotation -))))) + (cr/update! :flip-y not) + + (neg? dot-y) + (cr/update! :rotation -)))) (defn- apply-transform-move "Given a new set of points transformed, set up the rectangle so it keeps diff --git a/common/src/app/common/types/shape.cljc b/common/src/app/common/types/shape.cljc index 2101f90f7..e76fbe2a6 100644 --- a/common/src/app/common/types/shape.cljc +++ b/common/src/app/common/types/shape.cljc @@ -31,7 +31,7 @@ [app.common.uuid :as uuid] [clojure.set :as set])) -(cr/defrecord Shape [id name type x y width height rotation selrect points transform transform-inverse parent-id frame-id]) +(cr/defrecord Shape [id name type x y width height rotation selrect points transform transform-inverse parent-id frame-id flip-x flip-y]) (defn shape? [o]