-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flickering during animation #155
Comments
Hey, thank you for trying React Native Canvas and reporting this issue so well. I am not quite sure what is causing the flickering but it will require some debugging effort I can not fit into my schedule at the moment. Leads for solution and PRs are welcome though! |
Hi, @iddan ,I think the problem is caused by |
Hey @zhiqiangx, sure you can! I'd be happy to review it. |
Same issue calling Any news ? |
Came across the same flickering problem, any updates or helpful tips? |
Currently, I don't have a solution for this except not awaiting when drawing the frame. If someone figures it out let me know! |
I've found a dirty solution for this on Anderoid. This was an App killer until I discovered a solution. I added a second canvas (with fixed props so it shouldn't redraw) to get 2 canvases side by side at the same height. I noticed that only the left canvas flickers! So the fix is to add a dummy canvas with minimal width. Flicker is now completely gone, at least at the low frame rates I'm using. Code below. LtyLabel, and LtyLabelAxes contain a react-native-canvas.
|
@iddan First of all, thank you very much for this library, my app wouldn't be possible without it! However, I have now run into the same problem discussed here: clearing the canvas and redrawing causes extreme flickering, at least on Android (I cannot test this on iOS, unfortunately.) Have you made any progress on this? @zhiqiangx Did you ever get this working witht he solution you described above? |
Same problem! It flickers quite heavily on iOS too. |
+1 still on android 11 |
It's blinking a lot on Android too. T_T |
Still flickering, but only on Android :( |
I am testing out
react-native-canvas
to use for an animation. However, I am unable to draw a simple animation without a flickering. It looks as if the canvas is rendering to the display halfway through the drawing functions, but that's just a guess.Here is a video showing my test. The left view is in the browser, and the right view is with
react-native-canvas
in a simulator (btw it behaves the same when ran on device). You will notice the animation works just fine when ran in a browser.I have tried a few combinations of changes to see what would remove the flickering, but none have removed the flickering:
requestAnimationFrame
and also a slowsetTimeout
fillRect
that would erase the entire canvascanvas.width
andcanvas.height
inside draw functionsAnd my code is below:
The text was updated successfully, but these errors were encountered: