Skip to content

Commit

Permalink
mode "auto": move render_scheduled.status = false to the end of `re…
Browse files Browse the repository at this point in the history
…nder_standard()`

Otherwise `on:before_render` changes will schedule multiple renders!
Putting this to the very start of the function was completely false.
  • Loading branch information
Vatroslav Vrbanic committed Jun 15, 2022
1 parent 4a1b781 commit 07120b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/WebGLRenderer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,6 @@ This is a **svelthree** _WebGLRenderer_ Component.
}
async function render_standard(): Promise<void> {
if (mode === "auto") render_scheduled.status = false
// inside only -> if the `WebGLRenderer` component is placed inside a `Canvas` or a `Scene` component
if (!inputs && current_cam.userData.renderer_currentcam_needsupdate) {
current_cam.userData.renderer_currentcam_needsupdate = false
Expand All @@ -591,6 +589,8 @@ This is a **svelthree** _WebGLRenderer_ Component.
await dispatch_render_event("after_render", { frame: frames.total })
}
if (mode === "auto") render_scheduled.status = false
}
async function svelthree_extra(): Promise<void> {
Expand Down

0 comments on commit 07120b0

Please sign in to comment.