Skip to content

Commit

Permalink
[v9] fix: don't updateStyle on offscreen canvas (#2495)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett authored Sep 15, 2022
1 parent 3f928f5 commit 5b1bb20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/fiber/src/core/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,9 @@ const createStore = (
// Update camera & renderer
updateCamera(camera, size)
gl.setPixelRatio(viewport.dpr)
gl.setSize(size.width, size.height)
// Play nice with offscreen canvas contexts
const updateStyle = gl.domElement instanceof HTMLCanvasElement
gl.setSize(size.width, size.height, updateStyle)
}

// Update viewport once the camera changes
Expand Down

0 comments on commit 5b1bb20

Please sign in to comment.