Add no-buffer? option to update-shapes

This commit is contained in:
Elena Torro 2026-04-29 13:12:59 +02:00
parent a67eb0bda4
commit 1ffdf68e84
2 changed files with 8 additions and 6 deletions

View File

@ -765,11 +765,12 @@
(clear-local-transform)
(ptk/event ::dwg/move-frame-guides {:ids ids :transforms transforms})
(ptk/event ::dwcm/move-frame-comment-threads transforms)
(dwsh/update-shapes ids update-shape options)
(dwsh/update-shapes ids update-shape (assoc options :no-buffer? true))
;; The update to the bool path needs to be in a different operation because it
;; needs to have the updated children info
(dwsh/update-shapes bool-ids path/update-bool-shape (assoc options :with-objects? true)))
(dwsh/update-shapes bool-ids path/update-bool-shape
(assoc options :with-objects? true :no-buffer? true)))
(if undo-transation?
(rx/of (dwu/commit-undo-transaction undo-id))
@ -900,7 +901,7 @@
(rx/of (ptk/event ::dwg/move-frame-guides {:ids ids-with-children :modifiers object-modifiers})
(ptk/event ::dwcm/move-frame-comment-threads ids-with-children)
(dwsh/update-shapes ids update-shape options))))))
(dwsh/update-shapes ids update-shape (assoc options :no-buffer? true)))))))
(defn apply-modifiers
([]

View File

@ -141,12 +141,13 @@
([ids update-fn
{:as props
:keys [reg-objects? save-undo? stack-undo? attrs ignore-tree page-id
ignore-touched undo-group with-objects? changed-sub-attr]
ignore-touched undo-group with-objects? changed-sub-attr no-buffer?]
:or {reg-objects? false
save-undo? true
stack-undo? false
ignore-touched false
with-objects? false}}]
with-objects? false
no-buffer? false}}]
(assert (every? uuid? ids) "expect a coll of uuid for `ids`")
(assert (fn? update-fn) "the `update-fn` should be a valid function")
@ -155,7 +156,7 @@
ptk/WatchEvent
(watch [it state _]
(if (::update-shapes-buffer state)
(if (and (::update-shapes-buffer state) (not no-buffer?))
(rx/of (update-shapes-buffer ids update-fn props))
(let [page-id (or page-id (get state :current-page-id))