Skip to content

Commit

Permalink
Merge pull request #340 from Tresjs/fix/336-statsgl-broken
Browse files Browse the repository at this point in the history
fix(app): 336 Fix stats-gl problem
  • Loading branch information
JaimeTorrealba authored Jan 29, 2024
2 parents f10476e + 505e243 commit dffae6b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/misc/StatsGl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export const StatsGl = defineComponent<StatsGlProps>({
expose({ statsGl })

const node = document.body
node?.appendChild(statsGl.dom)
const statContainer = statsGl.dom || statsGl.container

node?.appendChild(statContainer)

const { renderer } = useTresContext()
const { onAfterLoop, resume } = useRenderLoop()
Expand All @@ -106,7 +108,8 @@ export const StatsGl = defineComponent<StatsGlProps>({
})

onUnmounted(() => {
node?.removeChild(statsGl.dom)
node?.removeChild(statContainer)
})
},

})

0 comments on commit dffae6b

Please sign in to comment.