mirror of
https://github.com/penpot/penpot.git
synced 2025-05-27 22:36:11 +02:00
🐛 Avoid extra render calls on page initialization with wasm render (#5701)
This commit is contained in:
parent
979de39768
commit
ce67550195
3 changed files with 26 additions and 13 deletions
|
@ -573,6 +573,19 @@
|
|||
(rx/reduce conj [])
|
||||
(rx/subs! request-render)))))
|
||||
|
||||
(defn set-canvas-background
|
||||
[background]
|
||||
(let [rgba (rgba-from-hex background 1)]
|
||||
(h/call internal-module "_set_canvas_background" rgba)
|
||||
(request-render "set-canvas-background")))
|
||||
|
||||
(defn initialize
|
||||
[base-objects zoom vbox background]
|
||||
(let [rgba (rgba-from-hex background 1)]
|
||||
(h/call internal-module "_set_canvas_background" rgba)
|
||||
(h/call internal-module "_set_view" zoom (- (:x vbox)) (- (:y vbox)))
|
||||
(set-objects base-objects)))
|
||||
|
||||
(def ^:private canvas-options
|
||||
#js {:antialias false
|
||||
:depth true
|
||||
|
@ -610,11 +623,6 @@
|
|||
;; TODO: perform corresponding cleaning
|
||||
(h/call internal-module "_clean_up"))
|
||||
|
||||
(defn set-canvas-background
|
||||
[background]
|
||||
(let [rgba (rgba-from-hex background 1)]
|
||||
(h/call internal-module "_set_canvas_background" rgba)))
|
||||
|
||||
(defonce module
|
||||
(delay
|
||||
(if (exists? js/dynamicImport)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue