mirror of
https://github.com/penpot/penpot.git
synced 2026-07-30 09:56:22 +00:00
🐛 Guard finalize-view-interaction! against spurious pointerup events (#10917)
Every pointerup unconditionally fires finish-panning and finish-zooming, which call finalize-view-interaction!. This triggered internal-render (and reset_canvas) on plain clicks — causing a visible white flash on large viewports or weak GPUs. Add a guard so finalize-view-interaction! only runs when a view interaction (pan/zoom) is actually active. Fixes #10915 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6063a45c3c
commit
c8d1f5b397
@ -1347,10 +1347,15 @@
|
||||
(or (:panning local) (:zooming local))))
|
||||
|
||||
(defn finalize-view-interaction!
|
||||
"Ends the view interaction and triggers a full-quality render."
|
||||
"Ends an in-progress pan/zoom view interaction and triggers a full-quality
|
||||
render. No-ops when no view interaction is active.
|
||||
|
||||
`finish-panning` runs on every pointerup, so without this guard we would
|
||||
call `internal-render` (and WASM `reset_canvas`) on plain clicks."
|
||||
[]
|
||||
(view-interaction-end!)
|
||||
(internal-render 0 0))
|
||||
(when @view-interaction-active?
|
||||
(view-interaction-end!)
|
||||
(internal-render 0 0)))
|
||||
|
||||
(def render-finish
|
||||
(letfn [(do-render []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user