mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 02:46:20 +00:00
⚡ Improve rulers loading time
This commit is contained in:
parent
94119159d8
commit
bfef6ea089
@ -17,7 +17,10 @@
|
|||||||
(defn initialize
|
(defn initialize
|
||||||
[enabled?]
|
[enabled?]
|
||||||
(if enabled?
|
(if enabled?
|
||||||
(set! app.common.types.path/wasm:calc-bool-content wasm.api/calculate-bool)
|
(do
|
||||||
|
(set! app.common.types.path/wasm:calc-bool-content wasm.api/calculate-bool)
|
||||||
|
;; Preload the WASM engine at boot so it's ready when a file opens.
|
||||||
|
(wasm.api/preload-module!))
|
||||||
(set! app.common.types.path/wasm:calc-bool-content nil))
|
(set! app.common.types.path/wasm:calc-bool-content nil))
|
||||||
(set! app.common.types.shape/wasm-enabled? enabled?)
|
(set! app.common.types.shape/wasm-enabled? enabled?)
|
||||||
(set! app.common.types.shape/wasm-create-shape wasm.shape/create-shape))
|
(set! app.common.types.shape/wasm-create-shape wasm.shape/create-shape))
|
||||||
|
|||||||
@ -2555,4 +2555,10 @@
|
|||||||
(p/resolved false)))))
|
(p/resolved false)))))
|
||||||
(p/resolved false))))
|
(p/resolved false))))
|
||||||
|
|
||||||
|
(defn preload-module!
|
||||||
|
"Starts downloading + compiling the WASM engine now instead of on first
|
||||||
|
viewport mount. Idempotent: the `delay` caches its in-flight promise."
|
||||||
|
[]
|
||||||
|
@module)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2234,6 +2234,10 @@ impl RenderState {
|
|||||||
} else {
|
} else {
|
||||||
self.reset_canvas();
|
self.reset_canvas();
|
||||||
self.interactive_target_seeded = false;
|
self.interactive_target_seeded = false;
|
||||||
|
// Paint rulers/frame now so they survive the progressive frames
|
||||||
|
// instead of blanking until the first full `present_frame`.
|
||||||
|
ui::render(self, tree);
|
||||||
|
self.flush_and_submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
let surface_ids = SurfaceId::Strokes as u32
|
let surface_ids = SurfaceId::Strokes as u32
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user