You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functioninitializeCanvas(p: p5){p.background(200);// error logged here when called after resizeCanvasp.noFill();}constSketch=(p: p5)=>{p.setup=()=>{const{ width, height }=p5Ref.current!.getBoundingClientRect();p.createCanvas(width,height);initializeCanvas(p);p.describe('Testing from React');};p.windowResized=()=>{const{ width, height }=p5Ref.current!.getBoundingClientRect();console.log('Window resized');p.resizeCanvas(width,height);initializeCanvas(p);};p.draw=()=>{const{ width, height }=p5Ref.current!.getBoundingClientRect();p.circle(30,30,40);p.circle(width-30,height-30,40);p.circle(width-30,30,40);p.circle(30,height-30,40);};};
The text was updated successfully, but these errors were encountered:
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!
Most appropriate sub-area of p5.js?
p5.js version
1.11.3
Web browser and version
Firefox 134.02
Operating system
Linux
Steps to reproduce this
This only seems to happen on Firefox: tried it with Chromium and everything was fine.
Steps:
windowResized
callback that callsresizeCanvas
on the instancebackground
afterwardsSnippet:
Full project at https://github.com/milgner/react-p5-sandbox/blob/main/src/App.tsx
The text was updated successfully, but these errors were encountered: