Improve create group tests

This commit is contained in:
Alejandro Alonso 2024-06-11 11:27:14 +02:00 committed by Andrey Antukh
parent 132908c224
commit a5ba9d113f
4 changed files with 59 additions and 6 deletions

View file

@ -198,7 +198,8 @@
(dws/select-shapes (d/ordered-set (:id group))))
(ptk/data-event :layout/update {:ids parents}))))))))
(def group-selected
(defn group-selected
[]
(ptk/reify ::group-selected
ptk/WatchEvent
(watch [_ state _]
@ -258,7 +259,8 @@
(when change-selection?
(dws/select-shapes child-ids))))))))
(def ungroup-selected
(defn ungroup-selected
[]
(ptk/reify ::ungroup-selected
ptk/WatchEvent
(watch [_ state _]

View file

@ -119,12 +119,12 @@
:group {:tooltip (ds/meta "G")
:command (ds/c-mod "g")
:subsections [:modify-layers]
:fn #(emit-when-no-readonly dw/group-selected)}
:fn #(emit-when-no-readonly (dw/group-selected))}
:ungroup {:tooltip (ds/shift "G")
:command "shift+g"
:subsections [:modify-layers]
:fn #(emit-when-no-readonly dw/ungroup-selected)}
:fn #(emit-when-no-readonly (dw/ungroup-selected))}
:mask {:tooltip (ds/meta "M")
:command (ds/c-mod "m")

View file

@ -243,8 +243,8 @@
is-group? (and single? has-group?)
is-bool? (and single? has-bool?)
do-create-group #(st/emit! dw/group-selected)
do-remove-group #(st/emit! dw/ungroup-selected)
do-create-group #(st/emit! (dw/group-selected))
do-remove-group #(st/emit! (dw/ungroup-selected))
do-mask-group #(st/emit! (dw/mask-group))
do-unmask-group #(st/emit! (dw/unmask-group))
do-create-artboard-from-selection