🐛 Fix problem with resize groups

This commit is contained in:
alonso.torres 2022-06-29 08:22:50 +02:00
parent ec55d64454
commit a271a285ad
3 changed files with 14 additions and 11 deletions

View file

@ -5,6 +5,7 @@
### :bug: Bugs fixed ### :bug: Bugs fixed
- Fix fill information not complete when paste plain text [Taiga #3680](https://tree.taiga.io/project/penpot/issue/3680) - 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 ## 1.14.1-beta

View file

@ -524,15 +524,17 @@
(gmt/translate (gpt/negate center))))))) (gmt/translate (gpt/negate center)))))))
(defn- set-flip [shape modifiers] (defn- set-flip [shape modifiers]
(let [rx (or (get-in modifiers [:resize-vector :x]) (let [rv1x (or (get-in modifiers [:resize-vector :x]) 1)
(get-in modifiers [:resize-vector-2 :x])) rv1y (or (get-in modifiers [:resize-vector :y]) 1)
ry (or (get-in modifiers [:resize-vector :y]) rv2x (or (get-in modifiers [:resize-vector-2 :x]) 1)
(get-in modifiers [:resize-vector-2 :y]))] rv2y (or (get-in modifiers [:resize-vector-2 :y]) 1)]
(cond-> shape (cond-> shape
(and rx (< rx 0)) (-> (update :flip-x not) (or (neg? rv1x) (neg? rv2x))
(update :rotation -)) (-> (update :flip-x not)
(and ry (< ry 0)) (-> (update :flip-y not) (update :rotation -))
(update :rotation -))))) (or (neg? rv1y) (neg? rv2y))
(-> (update :flip-y not)
(update :rotation -)))))
(defn- apply-displacement [shape] (defn- apply-displacement [shape]
(let [modifiers (:modifiers shape)] (let [modifiers (:modifiers shape)]

View file

@ -276,8 +276,7 @@
"Adjust modifiers so they adjust to the pixel grid" "Adjust modifiers so they adjust to the pixel grid"
[modifiers shape] [modifiers shape]
(if (or (some? (:resize-transform modifiers)) (if (some? (:resize-transform modifiers))
(some? (:resize-transform-2 modifiers)))
;; If we're working with a rotation we don't handle pixel precision because ;; If we're working with a rotation we don't handle pixel precision because
;; the transformation won't have the precision anyway ;; the transformation won't have the precision anyway
modifiers modifiers
@ -290,7 +289,8 @@
(gsh/points->rect)) (gsh/points->rect))
flip-x? (neg? (get-in modifiers [:resize-vector :x])) 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)) path? (= :path (:type shape))
vertical-line? (and path? (<= (:width raw-bounds) 0.01)) vertical-line? (and path? (<= (:width raw-bounds) 0.01))