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
initCanvas=(canvas)=>{// making sure this is called only onceif(!this.hasCanvasInited){this.hasCanvasInited=true;vardeltaTime=100;// These are switched because of landscape modecanvas.width=this.window_size.height;canvas.height=this.window_size.width+50;varcontext=canvas.getContext('2d');context.fillStyle='#DDA0DD';context.fillRect(0,0,canvas.width,canvas.height);context.save();// Wait few seconds before starting to avoid issues with canvas not being loaded yetsetTimeout(()=>{this.drawLoop(canvas,context,deltaTime);},1000);}}drawLoop=(canvas,context,deltaTime)=>{if(canvas!==null){context.restore();this.plotSine(context,0,canvas.height/2);setTimeout(()=>{this.canvasTimer+=deltaTime/1000;this.drawLoop(canvas,context,deltaTime);},deltaTime);}}plotSine=(ctx,x_offset,y_offset)=>{varheight=-125;varwidth=100;this.drawCircle(ctx,x_offset+(this.canvasTimer*width),y_offset+(height*Math.sin(this.canvasTimer*(Math.PI/2)-Math.PI*0.5)),30,'purple','purple',2);}drawCircle=(ctx,x,y,radius,fill,stroke,strokeWidth)=>{console.log(x,y);ctx.beginPath()ctx.arc(x,y,radius,0,2*Math.PI,false)if(fill){ctx.fillStyle=fillctx.fill()}if(stroke){ctx.lineWidth=strokeWidthctx.strokeStyle=strokectx.stroke()}}render(){return(<Canvasref={this.initCanvas}/>)}
This discussion was converted from issue #219 on December 17, 2021 21:58.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I am constantly getting this error when moving back from a page to another:
I noticed that this is an error coming from the webview: react-native-webview/react-native-webview#341
Is there anything we can do to fix it?
Here is my code:
Beta Was this translation helpful? Give feedback.
All reactions