From b57ddf9dcadfe4caab5c276a4d989ee43a210276 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 14 Jul 2022 15:01:39 +0200 Subject: [PATCH] :bug: Fix problem with 180 degree rotations --- CHANGES.md | 1 + common/src/app/common/geom/shapes/transforms.cljc | 10 +--------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0338f1009..b01d7191b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -35,6 +35,7 @@ - Fix problem with group coordinates [#2008](https://github.com/penpot/penpot/issues/2008) - Fix problem with line-height and texts [Taiga #3578](https://tree.taiga.io/project/penpot/issue/3578) - Fix moving frame-guides outside frames [Taiga #3839](https://tree.taiga.io/project/penpot/issue/3839) +- Fix problem with 180 degree rotations [#2082](https://github.com/penpot/penpot/issues/2082) ### :arrow_up: Deps updates diff --git a/common/src/app/common/geom/shapes/transforms.cljc b/common/src/app/common/geom/shapes/transforms.cljc index 5adb7e988..5d9977410 100644 --- a/common/src/app/common/geom/shapes/transforms.cljc +++ b/common/src/app/common/geom/shapes/transforms.cljc @@ -251,11 +251,6 @@ (gmt/rotate-matrix (- rotation-angle)))] [stretch-matrix stretch-matrix-inverse rotation-angle]))) -(defn is-rotated? - [[a b _c _d]] - ;; true if either a-b or c-d are parallel to the axis - (not (mth/close? (:y a) (:y b)))) - (defn- adjust-rotated-transform [{:keys [transform transform-inverse flip-x flip-y]} points] (let [center (gco/center-points points) @@ -287,12 +282,9 @@ points (gco/transform-points points' transform-mtx) bool? (= (:type shape) :bool) path? (= (:type shape) :path) - rotated? (is-rotated? points) [selrect transform transform-inverse] - (if (not rotated?) - [(gpr/points->selrect points) nil nil] - (adjust-rotated-transform shape points)) + (adjust-rotated-transform shape points) base-rotation (or (:rotation shape) 0) modif-rotation (or (get-in shape [:modifiers :rotation]) 0)