mirror of
https://github.com/penpot/penpot.git
synced 2026-08-24 05:38:38 +00:00
🐛 Fix selrect collapsing after undo (v3) (#11239)
This commit is contained in:
parent
6269fa7a3f
commit
e56c801820
@ -1329,7 +1329,16 @@
|
|||||||
finalize-save-undo-first?
|
finalize-save-undo-first?
|
||||||
(if (and finalize? (or (not new-shape?) (not content-has-text?)))
|
(if (and finalize? (or (not new-shape?) (not content-has-text?)))
|
||||||
false
|
false
|
||||||
effective-save-undo?)]
|
effective-save-undo?)
|
||||||
|
|
||||||
|
;; Whether any content-changing edit happened this editing session.
|
||||||
|
session-touched? (some? (get-in state [:workspace-text-session-geom id]))
|
||||||
|
;; A finalize on an existing shape that wasn't edited must not create any undo entry
|
||||||
|
;; (exception being newly created shapes)
|
||||||
|
finalize-no-op? (and finalize?
|
||||||
|
(not new-shape?)
|
||||||
|
content-has-text?
|
||||||
|
(not session-touched?))]
|
||||||
|
|
||||||
(rx/concat
|
(rx/concat
|
||||||
(rx/of
|
(rx/of
|
||||||
@ -1360,7 +1369,8 @@
|
|||||||
:undo-group (when new-shape? id)})
|
:undo-group (when new-shape? id)})
|
||||||
|
|
||||||
;; Push the auto-grow geometry to WASM/app state; the commit persists it via `resize-geom`.
|
;; Push the auto-grow geometry to WASM/app state; the commit persists it via `resize-geom`.
|
||||||
(when (some? resize-modifiers)
|
;; Skipped for a no-op finalize: applying it would record an undo transaction.
|
||||||
|
(when (and (some? resize-modifiers) (not finalize-no-op?))
|
||||||
(dwm/apply-wasm-modifiers resize-modifiers {:undo-group (when new-shape? id)})))
|
(dwm/apply-wasm-modifiers resize-modifiers {:undo-group (when new-shape? id)})))
|
||||||
|
|
||||||
(when finalize?
|
(when finalize?
|
||||||
@ -1378,7 +1388,7 @@
|
|||||||
(dwsh/delete-shapes #{id})))
|
(dwsh/delete-shapes #{id})))
|
||||||
(rx/empty))
|
(rx/empty))
|
||||||
(rx/concat
|
(rx/concat
|
||||||
(if content-has-text?
|
(if (and content-has-text? (not finalize-no-op?))
|
||||||
(rx/of
|
(rx/of
|
||||||
(dch/commit-changes
|
(dch/commit-changes
|
||||||
(build-finalize-commit-changes it state id
|
(build-finalize-commit-changes it state id
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user