🐛 Fix set X position from dimensions token (#5685)

This commit is contained in:
Eva Marco 2025-01-28 12:24:41 +01:00 committed by GitHub
parent b94afe143f
commit 0cf4d4636a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 20 deletions

View file

@ -787,7 +787,8 @@
(defn update-position
"Move shapes to a new position"
[id position]
([id position] (update-position id position nil))
([id position opts]
(dm/assert! (uuid? id))
(ptk/reify ::update-position
@ -796,7 +797,6 @@
(let [page-id (:current-page-id state)
objects (dsh/lookup-page-objects state page-id)
shape (get objects id)
;; FIXME: performance rect
bbox (-> shape :points grc/points->rect)
@ -810,7 +810,8 @@
(rx/of (dwm/apply-modifiers {:modifiers modif-tree
:ignore-constraints false
:ignore-snap-pixel true}))))))
:ignore-touched (:ignore-touched opts)
:ignore-snap-pixel true})))))))
(defn position-shapes
[shapes]

View file

@ -206,7 +206,7 @@
ptk/WatchEvent
(watch [_ _ _]
(rx/concat
(map #(dwt/update-position % (zipmap attributes (repeat value))) shape-ids)))))
(map #(dwt/update-position % (zipmap attributes (repeat value)) {:ignore-touched true}) shape-ids)))))
(defn update-layout-sizing-limits [value shape-ids attributes]
(ptk/reify ::update-layout-sizing-limits