Skip to content

Commit

Permalink
fix: Html positioning in gatsby site
Browse files Browse the repository at this point in the history
  • Loading branch information
brianzinn committed Mar 1, 2023
1 parent 45526d8 commit d5e61f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ const MyScene = () => {

useEffect(() => {
if (engine !== null) {
console.log('engine', engine)
cubeTextureRef.current = new CubeTexture('../../assets/textures/environment.env', engine)
const cubeTexture = new CubeTexture('../../assets/textures/environment.env', engine)
cubeTextureRef.current = cubeTexture
setTextureReady(true) // force a re-render to attach
console.log('texture:', cubeTextureRef.current)

return () => {
cubeTexture.dispose()
}
}
}, [engine])

Expand Down
2 changes: 1 addition & 1 deletion packages/static/content/examples/gui/html/Html.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const WithHtmlText: FC = () => {
}

const HtmlText = () => (
<div style={{ flex: 1, display: 'flex' }}>
<div style={{ position: 'relative', flex: 1, display: 'flex' }}>
<Engine antialias adaptToDeviceRatio canvasId="babylonJS">
<Scene>
<freeCamera name="camera1" position={new Vector3(0, 5, -10)} setTarget={[Vector3.Zero()]} />
Expand Down

0 comments on commit d5e61f4

Please sign in to comment.