mirror of
https://github.com/penpot/penpot.git
synced 2025-01-22 22:49:01 -05:00
🐛 Fix ghost shapes after sync groups in components
This commit is contained in:
parent
94fc067286
commit
bedaef961b
2 changed files with 24 additions and 19 deletions
|
@ -39,6 +39,7 @@
|
|||
- Fix group/ungroup shapes inside a component [Taiga #4052](https://tree.taiga.io/project/penpot/issue/4052)
|
||||
- Fix wrong update of text in components [Taiga #4646](https://tree.taiga.io/project/penpot/issue/4646)
|
||||
- Fix problem with SVG imports with style [#2605](https://github.com/penpot/penpot/issues/2605)
|
||||
- Fix ghost shapes after sync groups in components [Taiga #4649](https://tree.taiga.io/project/penpot/issue/4649)
|
||||
|
||||
## 1.16.2-beta
|
||||
|
||||
|
|
|
@ -915,32 +915,36 @@
|
|||
parents (cph/get-parent-ids objects (:id shape))
|
||||
parent (first parents)
|
||||
children (cph/get-children-ids objects (:id shape))
|
||||
ids (into [(:id shape)] children)
|
||||
|
||||
add-redo-change (fn [changes id]
|
||||
(update changes :redo-changes conj
|
||||
(make-change
|
||||
container
|
||||
{:type :del-obj
|
||||
:id id
|
||||
:ignore-touched true})))
|
||||
|
||||
add-undo-change (fn [changes id]
|
||||
(let [shape' (get objects id)]
|
||||
(update changes :undo-changes d/preconj
|
||||
(make-change
|
||||
container
|
||||
(as-> {:type :add-obj
|
||||
:id id
|
||||
:index (cph/get-position-on-parent objects id)
|
||||
:parent-id (:parent-id shape')
|
||||
:ignore-touched true
|
||||
:obj shape'} $
|
||||
(cond-> $
|
||||
(:frame-id shape')
|
||||
(assoc :frame-id (:frame-id shape'))))))))
|
||||
container
|
||||
(as-> {:type :add-obj
|
||||
:id id
|
||||
:index (cph/get-position-on-parent objects id)
|
||||
:parent-id (:parent-id shape')
|
||||
:ignore-touched true
|
||||
:obj shape'} $
|
||||
(cond-> $
|
||||
(:frame-id shape')
|
||||
(assoc :frame-id (:frame-id shape'))))))))
|
||||
|
||||
changes' (-> changes
|
||||
changes' (-> (reduce add-redo-change changes ids)
|
||||
(update :redo-changes conj (make-change
|
||||
container
|
||||
{:type :del-obj
|
||||
:id (:id shape)
|
||||
:ignore-touched true}))
|
||||
(update :redo-changes conj (make-change
|
||||
container
|
||||
{:type :reg-objects
|
||||
:shapes (vec parents)}))
|
||||
container
|
||||
{:type :reg-objects
|
||||
:shapes (vec parents)}))
|
||||
(add-undo-change (:id shape)))
|
||||
|
||||
changes' (reduce add-undo-change
|
||||
|
|
Loading…
Add table
Reference in a new issue