💄 Add minor cosmetic changes to measures menu

This commit is contained in:
Andrey Antukh 2025-03-19 15:11:54 +01:00
parent 7fdb0873db
commit b8c5a10551

View file

@ -175,7 +175,7 @@
show-in-viewer-ref (mf/use-ref nil) show-in-viewer-ref (mf/use-ref nil)
;; PRESETS ;; PRESETS
preset-state* (mf/use-state false) preset-state* (mf/use-state false)
show-presets-dropdown? (deref preset-state*) show-presets-dropdown? (deref preset-state*)
open-presets open-presets
@ -205,11 +205,11 @@
;; ORIENTATION ;; ORIENTATION
orientation (when (= type :frame) orientation
(cond (> (:width values) (:height values)) (when (= type :frame)
:horiz (if (> (:width values) (:height values))
:else :horiz
:vert)) :vert))
on-orientation-change on-orientation-change
(mf/use-fn (mf/use-fn
@ -235,10 +235,8 @@
(run! #(st/emit! (udw/set-shape-proportion-lock % new-lock)) ids)))) (run! #(st/emit! (udw/set-shape-proportion-lock % new-lock)) ids))))
;; POSITION ;; POSITION
do-position-change do-position-change
(mf/use-fn (mf/use-fn
(mf/deps ids)
(fn [shape' value attr] (fn [shape' value attr]
(st/emit! (udw/update-position (:id shape') {attr value})))) (st/emit! (udw/update-position (:id shape') {attr value}))))
@ -248,7 +246,7 @@
(fn [value attr] (fn [value attr]
(st/emit! (udw/trigger-bounding-box-cloaking ids)) (st/emit! (udw/trigger-bounding-box-cloaking ids))
(binding [cts/*wasm-sync* true] (binding [cts/*wasm-sync* true]
(doall (map #(do-position-change %1 value attr) shapes))))) (run! #(do-position-change %1 value attr) shapes))))
;; ROTATION ;; ROTATION