mirror of
https://github.com/penpot/penpot.git
synced 2025-01-11 01:10:28 -05:00
⏪ Revert some changes from previous merge
This commit is contained in:
parent
4af851d4c6
commit
8e2ccfb4b0
1 changed files with 15 additions and 16 deletions
|
@ -163,27 +163,26 @@
|
|||
(watch [it state _]
|
||||
(let [page-id (:current-page-id state)
|
||||
objects (wsh/lookup-page-objects state page-id)
|
||||
is-group? #(or (= :bool (:type %)) (= :group (:type %)))
|
||||
lookup #(get objects %)
|
||||
prepare #(prepare-remove-group it page-id % objects)
|
||||
selected (wsh/lookup-selected state)
|
||||
children (into (d/ordered-set)
|
||||
(mapcat #(->> %
|
||||
lookup
|
||||
:shapes) selected))
|
||||
|
||||
prepare
|
||||
(fn [shape-id]
|
||||
(let [shape (get objects shape-id)]
|
||||
(cond
|
||||
(or (cph/group-shape? shape) (cph/bool-shape? shape))
|
||||
(remove-group-changes it page-id shape objects)
|
||||
|
||||
(cph/frame-shape? shape)
|
||||
(remove-frame-changes it page-id shape objects))))
|
||||
|
||||
changes-list (sequence
|
||||
(comp (map lookup)
|
||||
(filter is-group?)
|
||||
(map prepare))
|
||||
selected)
|
||||
(keep prepare)
|
||||
(wsh/lookup-selected state))
|
||||
|
||||
changes {:redo-changes (vec (mapcat :redo-changes changes-list))
|
||||
:undo-changes (vec (mapcat :undo-changes changes-list))
|
||||
:origin it}]
|
||||
|
||||
(rx/of (dch/commit-changes changes)
|
||||
(dws/select-shapes children))))))
|
||||
(rx/of (dch/commit-changes changes))))))
|
||||
|
||||
(def mask-group
|
||||
(ptk/reify ::mask-group
|
||||
|
|
Loading…
Reference in a new issue