Skip to content

Commit

Permalink
fix: message canvas 0 height false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
JaimeTorrealba committed Jun 3, 2023
1 parent 4189083 commit bdfbdfe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/composables/useRenderer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,12 @@ export function useRenderer(options: UseRendererOptions) {
const { pause, resume } = useRenderLoop()
const aspectRatio = computed(() => width.value / height.value)

if (!toValue(windowSize) && state.container?.value?.offsetHeight === 0) {
logWarning(`Oops... Seems like your canvas height is currently 0px, by default it takes the height of it's parent, so make sure it has some height with CSS.
You could set windowSize=true to force the canvas to be the size of the window.`)
}
setTimeout(() => {
if (!toValue(windowSize) && !state.canvas.value.offsetHeight) {
logWarning(`Oops... Seems like your canvas height is currently 0px, it's posible that you couldn't watch your scene.
You could set windowSize=true to force the canvas to be the size of the window.`)
}
}, 1000)

const updateRendererSize = () => {
if (!renderer.value) {
Expand Down

0 comments on commit bdfbdfe

Please sign in to comment.