mirror of
https://github.com/penpot/penpot.git
synced 2025-06-02 09:41:41 +02:00
🐛 Fix asynchronous content dependant rendering (#6142)
* 🐛 Fix custom fonts rendering * 🐛 Fix asynchronous content dependant rendering * 🎉 Renaming clear_cache to clear_drawing_cache
This commit is contained in:
parent
9653e72e47
commit
065b50f5a2
4 changed files with 24 additions and 10 deletions
|
@ -777,8 +777,8 @@
|
|||
(h/call internal-module "_set_view" zoom (- (:x vbox)) (- (:y vbox)))
|
||||
(render nil))
|
||||
|
||||
(defn clear-cache []
|
||||
(h/call internal-module "_clear_cache"))
|
||||
(defn clear-drawing-cache []
|
||||
(h/call internal-module "_clear_drawing_cache"))
|
||||
|
||||
(defn- store-all-fonts
|
||||
[fonts]
|
||||
|
@ -803,7 +803,9 @@
|
|||
(->> (rx/from pending)
|
||||
(rx/mapcat identity)
|
||||
(rx/reduce conj [])
|
||||
(rx/subs! request-render))))
|
||||
(rx/subs! (fn [_]
|
||||
(clear-drawing-cache)
|
||||
(request-render "set-fonts"))))))
|
||||
|
||||
(defn set-objects
|
||||
[objects]
|
||||
|
@ -886,13 +888,15 @@
|
|||
(let [pending' (concat (set-shape-fills fills) (set-shape-strokes strokes))]
|
||||
(recur (inc index) (into pending pending'))))
|
||||
pending))]
|
||||
(clear-cache)
|
||||
(clear-drawing-cache)
|
||||
(request-render "set-objects")
|
||||
(when-let [pending (seq pending)]
|
||||
(->> (rx/from pending)
|
||||
(rx/mapcat identity)
|
||||
(rx/reduce conj [])
|
||||
(rx/subs! request-render)))))
|
||||
(rx/subs! (fn [_]
|
||||
(clear-drawing-cache)
|
||||
(request-render "set-objects")))))))
|
||||
|
||||
(defn uuid->u8
|
||||
[id]
|
||||
|
|
|
@ -145,7 +145,7 @@
|
|||
;; when something synced with wasm
|
||||
;; is modified, we need to request
|
||||
;; a new render.
|
||||
(api/clear-cache)
|
||||
(api/clear-drawing-cache)
|
||||
(api/request-render "set-wasm-attrs")))
|
||||
|
||||
(defn- impl-assoc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue