mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
🐛 Fix errors in thumbnails
This commit is contained in:
parent
c636517499
commit
2901d00862
@ -334,7 +334,7 @@
|
||||
|
||||
(defn request-render
|
||||
[_requester]
|
||||
(when (and wasm/context-initialized? (not @wasm/context-lost?))
|
||||
(when (and wasm/context-initialized? (not @wasm/context-lost?) (not @wasm/disable-request-render?))
|
||||
(if @shapes-loading?
|
||||
(register-deferred-render!)
|
||||
(when-not @pending-render
|
||||
@ -1698,6 +1698,8 @@
|
||||
[]
|
||||
(when wasm/context-initialized?
|
||||
(try
|
||||
(set! wasm/context-initialized? false)
|
||||
|
||||
;; Cancel any pending animation frame to prevent race conditions
|
||||
(when wasm/internal-frame-id
|
||||
(js/cancelAnimationFrame wasm/internal-frame-id)
|
||||
@ -1708,8 +1710,6 @@
|
||||
(reset! shapes-loading? false)
|
||||
(reset! deferred-render? false)
|
||||
|
||||
;; TODO: perform corresponding cleaning
|
||||
(set! wasm/context-initialized? false)
|
||||
(h/call wasm/internal-module "_clean_up")
|
||||
|
||||
;; Remove event listener for WebGL context lost
|
||||
|
||||
@ -26,6 +26,9 @@
|
||||
(defonce context-initialized? false)
|
||||
(defonce context-lost? (atom false))
|
||||
|
||||
;; When we're rendering in a sync way we want to stop the asynchrous `request-render`
|
||||
(defonce disable-request-render? (atom false))
|
||||
|
||||
|
||||
(defonce serializers
|
||||
#js {:blur-type shared/RawBlurType
|
||||
|
||||
@ -170,6 +170,7 @@
|
||||
(render/calculate-dimensions objects thumbnail-aspect-ratio))
|
||||
zoom (/ width (:width vbox))]
|
||||
|
||||
(reset! wasm/disable-request-render? true)
|
||||
(wasm.api/initialize-viewport
|
||||
objects zoom vbox
|
||||
:background bgcolor
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user