0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 22:49:01 -05:00

🐛 Fix layers get out of their group when moved

Signed-off-by: Andrei Zhurau <zhurov.andrew@gmail.com>
This commit is contained in:
Andrew Zhurov 2022-07-30 12:15:01 +03:00 committed by Andrey Antukh
parent 87419d63a5
commit d270c9670e
2 changed files with 2 additions and 9 deletions

View file

@ -13,6 +13,7 @@
- Fix unexpected removal of guides on copy&paste frames [Taiga #3887](https://tree.taiga.io/project/penpot/issue/3887) by @andrewzhurov - Fix unexpected removal of guides on copy&paste frames [Taiga #3887](https://tree.taiga.io/project/penpot/issue/3887) by @andrewzhurov
- Fix props preserving on copy&paste texts [Taiga #3629](https://tree.taiga.io/project/penpot/issue/3629) by @andrewzhurov - Fix props preserving on copy&paste texts [Taiga #3629](https://tree.taiga.io/project/penpot/issue/3629) by @andrewzhurov
- Fix unexpected layers ungrouping on moving it [Taiga #3932](https://tree.taiga.io/project/penpot/issue/3932) by @andrewzhurov
### :arrow_up: Deps updates ### :arrow_up: Deps updates
### :heart: Community contributions by (Thank you!) ### :heart: Community contributions by (Thank you!)

View file

@ -739,14 +739,6 @@
(rx/of (set-modifiers [id] {:displacement displ} false true) (rx/of (set-modifiers [id] {:displacement displ} false true)
(apply-modifiers)))))) (apply-modifiers))))))
(defn check-frame-move?
[target-frame-id objects position shape]
(let [current-frame (get objects (:frame-id shape))]
;; If the current frame contains the point and it's a child of the target
(and (gsh/has-point? current-frame position)
(cph/is-child? objects target-frame-id (:id current-frame)))))
(defn- calculate-frame-for-move (defn- calculate-frame-for-move
[ids] [ids]
(ptk/reify ::calculate-frame-for-move (ptk/reify ::calculate-frame-for-move
@ -761,7 +753,7 @@
(->> ids (->> ids
(cph/clean-loops objects) (cph/clean-loops objects)
(keep #(get objects %)) (keep #(get objects %))
(remove (partial check-frame-move? frame-id objects position))) (remove #(= (:frame-id %) frame-id)))
moving-frames moving-frames
(->> ids (->> ids