mirror of
https://github.com/penpot/penpot.git
synced 2026-09-10 22:19:19 +00:00
🐛 Re-upload WASM text after WebGL context restore (#11589)
During reload-renderer!, reloading? keeps initialized?/ready? false while set-objects runs (especially the sync path for small files). Text content used that guard and was skipped; geometry already used live?. Gate use-shape, has-shape, and set-shape-text-content on wasm/live? so text is restored with the rest of the shapes.
This commit is contained in:
parent
43f7e49aa0
commit
ac84557740
@ -658,7 +658,9 @@
|
||||
|
||||
(defn use-shape
|
||||
[id]
|
||||
(when (initialized?)
|
||||
;; Use `wasm/live?` (not `initialized?`) so context-restore reload can
|
||||
;; select shapes while `reloading?` still blocks external app callers.
|
||||
(when (wasm/live?)
|
||||
(let [buffer (uuid/get-u32 id)]
|
||||
(h/call wasm/internal-module "_use_shape"
|
||||
(aget buffer 0)
|
||||
@ -668,7 +670,7 @@
|
||||
|
||||
(defn has-shape
|
||||
[id]
|
||||
(when (initialized?)
|
||||
(when (wasm/live?)
|
||||
(let [buffer (uuid/get-u32 id)
|
||||
|
||||
result
|
||||
@ -686,9 +688,11 @@
|
||||
;; Cache content for text editor sync
|
||||
(text-editor/cache-shape-text-content! shape-id content)
|
||||
|
||||
;; The WASM design state may not be ready (e.g. while switching renderer
|
||||
;; with a text shape being edited). Skip the WASM layout calls in that case.
|
||||
(when (initialized?)
|
||||
;; Skip when the GL/WASM context is not usable. Use `wasm/live?` (not
|
||||
;; `initialized?`) so context-restore reload can re-upload text while
|
||||
;; `reloading?` still blocks external app callers. Geometry shapes already
|
||||
;; use `live?` via `set-shape-base-props`; text must match that path.
|
||||
(when (wasm/live?)
|
||||
(h/call wasm/internal-module "_clear_shape_text")
|
||||
|
||||
(set-shape-vertical-align (get content :vertical-align))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user