mirror of
https://github.com/penpot/penpot.git
synced 2025-06-10 19:21:39 +02:00
Merge pull request #2749 from penpot/hiru-fix-ghost-sync
🐛 Fix ghost shapes after sync groups in components
This commit is contained in:
commit
35aa391129
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 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 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 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
|
## 1.16.2-beta
|
||||||
|
|
||||||
|
|
|
@ -915,32 +915,36 @@
|
||||||
parents (cph/get-parent-ids objects (:id shape))
|
parents (cph/get-parent-ids objects (:id shape))
|
||||||
parent (first parents)
|
parent (first parents)
|
||||||
children (cph/get-children-ids objects (:id shape))
|
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]
|
add-undo-change (fn [changes id]
|
||||||
(let [shape' (get objects id)]
|
(let [shape' (get objects id)]
|
||||||
(update changes :undo-changes d/preconj
|
(update changes :undo-changes d/preconj
|
||||||
(make-change
|
(make-change
|
||||||
container
|
container
|
||||||
(as-> {:type :add-obj
|
(as-> {:type :add-obj
|
||||||
:id id
|
:id id
|
||||||
:index (cph/get-position-on-parent objects id)
|
:index (cph/get-position-on-parent objects id)
|
||||||
:parent-id (:parent-id shape')
|
:parent-id (:parent-id shape')
|
||||||
:ignore-touched true
|
:ignore-touched true
|
||||||
:obj shape'} $
|
:obj shape'} $
|
||||||
(cond-> $
|
(cond-> $
|
||||||
(:frame-id shape')
|
(:frame-id shape')
|
||||||
(assoc :frame-id (:frame-id shape'))))))))
|
(assoc :frame-id (:frame-id shape'))))))))
|
||||||
|
|
||||||
changes' (-> changes
|
changes' (-> (reduce add-redo-change changes ids)
|
||||||
(update :redo-changes conj (make-change
|
(update :redo-changes conj (make-change
|
||||||
container
|
container
|
||||||
{:type :del-obj
|
{:type :reg-objects
|
||||||
:id (:id shape)
|
:shapes (vec parents)}))
|
||||||
:ignore-touched true}))
|
|
||||||
(update :redo-changes conj (make-change
|
|
||||||
container
|
|
||||||
{:type :reg-objects
|
|
||||||
:shapes (vec parents)}))
|
|
||||||
(add-undo-change (:id shape)))
|
(add-undo-change (:id shape)))
|
||||||
|
|
||||||
changes' (reduce add-undo-change
|
changes' (reduce add-undo-change
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue