mirror of
https://github.com/penpot/penpot.git
synced 2025-05-11 21:46:38 +02:00
🐛 Fix problem with order of operations
This commit is contained in:
parent
8363b86cfa
commit
0590336c71
2 changed files with 14 additions and 8 deletions
|
@ -546,10 +546,7 @@
|
||||||
:layout-padding-type
|
:layout-padding-type
|
||||||
:layout-gap
|
:layout-gap
|
||||||
:layout-item-margin
|
:layout-item-margin
|
||||||
:layout-item-margin-type
|
:layout-item-margin-type]})
|
||||||
:layout-grid-cells
|
|
||||||
:layout-grid-columns
|
|
||||||
:layout-grid-rows]})
|
|
||||||
;; We've applied the text-modifier so we can dissoc the temporary data
|
;; We've applied the text-modifier so we can dissoc the temporary data
|
||||||
(fn [state]
|
(fn [state]
|
||||||
(update state :workspace-text-modifier #(apply dissoc % ids)))
|
(update state :workspace-text-modifier #(apply dissoc % ids)))
|
||||||
|
|
|
@ -606,11 +606,11 @@
|
||||||
(->> move-stream
|
(->> move-stream
|
||||||
(rx/last)
|
(rx/last)
|
||||||
(rx/mapcat
|
(rx/mapcat
|
||||||
(fn [[_ target-frame drop-index]]
|
(fn [[_ target-frame drop-index cell-data]]
|
||||||
(let [undo-id (js/Symbol)]
|
(let [undo-id (js/Symbol)]
|
||||||
(rx/of (dwu/start-undo-transaction undo-id)
|
(rx/of (dwu/start-undo-transaction undo-id)
|
||||||
(move-shapes-to-frame ids target-frame drop-index)
|
|
||||||
(dwm/apply-modifiers {:undo-transation? false})
|
(dwm/apply-modifiers {:undo-transation? false})
|
||||||
|
(move-shapes-to-frame ids target-frame drop-index cell-data)
|
||||||
(finish-transform)
|
(finish-transform)
|
||||||
(dwu/commit-undo-transaction undo-id))))))))))))))
|
(dwu/commit-undo-transaction undo-id))))))))))))))
|
||||||
|
|
||||||
|
@ -832,7 +832,7 @@
|
||||||
:ignore-snap-pixel true}))))))
|
:ignore-snap-pixel true}))))))
|
||||||
|
|
||||||
(defn- move-shapes-to-frame
|
(defn- move-shapes-to-frame
|
||||||
[ids frame-id drop-index]
|
[ids frame-id drop-index [row column :as cell]]
|
||||||
(ptk/reify ::move-shapes-to-frame
|
(ptk/reify ::move-shapes-to-frame
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [it state _]
|
(watch [it state _]
|
||||||
|
@ -924,7 +924,16 @@
|
||||||
(pcb/update-shapes shape-ids-to-detach ctk/detach-shape)
|
(pcb/update-shapes shape-ids-to-detach ctk/detach-shape)
|
||||||
(pcb/change-parent frame-id moving-shapes drop-index)
|
(pcb/change-parent frame-id moving-shapes drop-index)
|
||||||
(cond-> (ctl/grid-layout? objects frame-id)
|
(cond-> (ctl/grid-layout? objects frame-id)
|
||||||
(-> (pcb/update-shapes [frame-id] ctl/assign-cell-positions {:with-objects? true})
|
(-> (pcb/update-shapes
|
||||||
|
[frame-id]
|
||||||
|
(fn [frame objects]
|
||||||
|
(-> frame
|
||||||
|
;; Assign the cell when pushing into a specific grid cell
|
||||||
|
(cond-> (some? cell)
|
||||||
|
(-> (ctl/push-into-cell moving-shapes-ids row column)
|
||||||
|
(ctl/assign-cells objects)))
|
||||||
|
(ctl/assign-cell-positions objects)))
|
||||||
|
{:with-objects? true})
|
||||||
(pcb/reorder-grid-children [frame-id])))
|
(pcb/reorder-grid-children [frame-id])))
|
||||||
(pcb/remove-objects empty-parents))]
|
(pcb/remove-objects empty-parents))]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue