mirror of
https://github.com/penpot/penpot.git
synced 2025-05-24 00:06:11 +02:00
🐛 Fix race condition when rendering the background color before shape tree has been initialized
This commit is contained in:
parent
2d955a2256
commit
3d370de49e
1 changed files with 4 additions and 5 deletions
|
@ -284,8 +284,7 @@
|
||||||
(p/fmap (fn [ready?]
|
(p/fmap (fn [ready?]
|
||||||
(when ready?
|
(when ready?
|
||||||
(reset! canvas-init? true)
|
(reset! canvas-init? true)
|
||||||
(wasm.api/assign-canvas canvas)
|
(wasm.api/assign-canvas canvas)))))
|
||||||
(wasm.api/set-canvas-background background)))))
|
|
||||||
(fn []
|
(fn []
|
||||||
(wasm.api/clear-canvas))))
|
(wasm.api/clear-canvas))))
|
||||||
|
|
||||||
|
@ -293,15 +292,15 @@
|
||||||
(when @canvas-init?
|
(when @canvas-init?
|
||||||
(wasm.api/resize-viewbox (:width vport) (:height vport))))
|
(wasm.api/resize-viewbox (:width vport) (:height vport))))
|
||||||
|
|
||||||
(mf/with-effect [base-objects canvas-init?]
|
(mf/with-effect [base-objects @canvas-init?]
|
||||||
(when @canvas-init?
|
(when @canvas-init?
|
||||||
(wasm.api/set-objects base-objects)))
|
(wasm.api/set-objects base-objects)))
|
||||||
|
|
||||||
(mf/with-effect [preview-blend canvas-init?]
|
(mf/with-effect [preview-blend @canvas-init?]
|
||||||
(when (and @canvas-init? preview-blend)
|
(when (and @canvas-init? preview-blend)
|
||||||
(wasm.api/request-render)))
|
(wasm.api/request-render)))
|
||||||
|
|
||||||
(mf/with-effect [vbox canvas-init?]
|
(mf/with-effect [vbox @canvas-init?]
|
||||||
(when @canvas-init?
|
(when @canvas-init?
|
||||||
(wasm.api/set-view zoom vbox)))
|
(wasm.api/set-view zoom vbox)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue