🐛 Fix touched detection when moving instances

This commit is contained in:
Andrés Moya 2022-10-03 12:19:01 +02:00
parent 7dcd362abd
commit e9d3e8a643
2 changed files with 5 additions and 3 deletions

View file

@ -38,6 +38,7 @@
- Fix change multiple colors with SVG [Taiga #3889](https://tree.taiga.io/project/penpot/issue/3889) - Fix change multiple colors with SVG [Taiga #3889](https://tree.taiga.io/project/penpot/issue/3889)
- Fix ungroup does not work for typographies [Taiga #4195](https://tree.taiga.io/project/penpot/issue/4195) - Fix ungroup does not work for typographies [Taiga #4195](https://tree.taiga.io/project/penpot/issue/4195)
- Fix inviting to non existing users can fail [Taiga #4108](https://tree.taiga.io/project/penpot/issue/4108) - Fix inviting to non existing users can fail [Taiga #4108](https://tree.taiga.io/project/penpot/issue/4108)
- Fix components marked as touched when moved [Taiga #4061](https://tree.taiga.io/project/penpot/task/4061)
### :arrow_up: Deps updates ### :arrow_up: Deps updates
### :heart: Community contributions by (Thank you!) ### :heart: Community contributions by (Thank you!)

View file

@ -243,7 +243,7 @@
(defn- check-delta (defn- check-delta
"If the shape is a component instance, check its relative position respect the "If the shape is a component instance, check its relative position respect the
root of the component, and see if it changes after applying a transformation." root of the component, and see if it changes after applying a transformation."
[shape root transformed-shape transformed-root objects] [shape root transformed-shape transformed-root objects modif-tree]
(let [root (let [root
(cond (cond
(:component-root? shape) (:component-root? shape)
@ -260,7 +260,8 @@
transformed-shape transformed-shape
(nil? transformed-root) (nil? transformed-root)
(cph/get-root-shape objects transformed-shape) (as-> (cph/get-root-shape objects transformed-shape) $
(gsh/transform-shape (merge $ (get modif-tree (:id $)))))
:else transformed-root) :else transformed-root)
@ -298,7 +299,7 @@
transformed-shape (gsh/transform-shape (merge shape (get modif-tree shape-id))) transformed-shape (gsh/transform-shape (merge shape (get modif-tree shape-id)))
[root transformed-root ignore-geometry?] [root transformed-root ignore-geometry?]
(check-delta shape root transformed-shape transformed-root objects) (check-delta shape root transformed-shape transformed-root objects modif-tree)
ignore-tree (assoc ignore-tree shape-id ignore-geometry?) ignore-tree (assoc ignore-tree shape-id ignore-geometry?)