mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 02:26:12 +02:00
🐛 Fix issue when undo after changing the artboard of a shape
This commit is contained in:
parent
47e0c2c75b
commit
d263dd52e9
4 changed files with 17 additions and 5 deletions
|
@ -19,6 +19,7 @@
|
||||||
- Fix problem with mask and flip [#715](https://github.com/penpot/penpot/issues/715)
|
- Fix problem with mask and flip [#715](https://github.com/penpot/penpot/issues/715)
|
||||||
- Fix problem with rotated blur [Taiga #1370](https://tree.taiga.io/project/penpot/issue/1370)
|
- Fix problem with rotated blur [Taiga #1370](https://tree.taiga.io/project/penpot/issue/1370)
|
||||||
- Disables buttons in view mode for users without permissions [Taiga #1328](https://tree.taiga.io/project/penpot/issue/1328)
|
- Disables buttons in view mode for users without permissions [Taiga #1328](https://tree.taiga.io/project/penpot/issue/1328)
|
||||||
|
- Fix issue when undo after changing the artboard of a shape [Taiga #1304](https://tree.taiga.io/project/penpot/issue/1304)
|
||||||
|
|
||||||
### :heart: Community contributions by (Thank you!)
|
### :heart: Community contributions by (Thank you!)
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@
|
||||||
(d/export helpers/touched-group?)
|
(d/export helpers/touched-group?)
|
||||||
(d/export helpers/get-base-shape)
|
(d/export helpers/get-base-shape)
|
||||||
(d/export helpers/is-parent?)
|
(d/export helpers/is-parent?)
|
||||||
|
(d/export helpers/get-index-in-parent)
|
||||||
|
|
||||||
;; Process changes
|
;; Process changes
|
||||||
(d/export changes/process-changes)
|
(d/export changes/process-changes)
|
||||||
|
|
|
@ -401,3 +401,12 @@
|
||||||
(recur (get objects (first pending))
|
(recur (get objects (first pending))
|
||||||
(conj done (:id current))
|
(conj done (:id current))
|
||||||
(concat (rest pending) (:shapes current))))))
|
(concat (rest pending) (:shapes current))))))
|
||||||
|
|
||||||
|
(defn get-index-in-parent
|
||||||
|
"Retrieves the index in the parent"
|
||||||
|
[objects shape-id]
|
||||||
|
(let [shape (get objects shape-id)
|
||||||
|
parent (get objects (:parent-id shape))
|
||||||
|
[parent-idx _] (d/seek (fn [[idx child-id]] (= child-id shape-id))
|
||||||
|
(d/enumerate (:shapes parent)))]
|
||||||
|
parent-idx))
|
||||||
|
|
|
@ -249,14 +249,15 @@
|
||||||
:parent-id frame-id
|
:parent-id frame-id
|
||||||
:shapes (mapv :id moving-shapes)}]
|
:shapes (mapv :id moving-shapes)}]
|
||||||
|
|
||||||
moving-shapes-by-frame-id (group-by :frame-id moving-shapes)
|
|
||||||
|
|
||||||
uch (->> moving-shapes-by-frame-id
|
uch (->> moving-shapes
|
||||||
(mapv (fn [[frame-id shapes]]
|
(reverse)
|
||||||
|
(mapv (fn [shape]
|
||||||
{:type :mov-objects
|
{:type :mov-objects
|
||||||
:page-id page-id
|
:page-id page-id
|
||||||
:parent-id frame-id
|
:parent-id (:parent-id shape)
|
||||||
:shapes (mapv :id shapes)})))]
|
:index (cp/get-index-in-parent objects (:id shape))
|
||||||
|
:shapes [(:id shape)]})))]
|
||||||
|
|
||||||
(when-not (empty? rch)
|
(when-not (empty? rch)
|
||||||
(rx/of dwc/pop-undo-into-transaction
|
(rx/of dwc/pop-undo-into-transaction
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue