Replies: 2 comments 11 replies
-
Beta Was this translation helpful? Give feedback.
9 replies
-
If i disable cache, on my machine the normal time goes down to 8ms. It may change depending on how many objects are on screen on that moment. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
CheckList
Version
6.0.2
In What environments are you experiencing the problem?
Firefox, Chrome
Node Version (if applicable)
None
Link To Reproduction
https://codepen.io/Fjonan/pen/JoPJmVr
Steps To Reproduce
Expected Behavior
The canvas resize and sets a new zoom level should happen in a reasonable amount of time (~3 - 5 seconds).
Actual Behavior
On mobile devices the canvas update takes multiple minutes
I build a demo where zooming a canvas using pinch or mouse wheel uses CSS
transform: scale
to "zoom" the canvas which is a lot faster than usingzoomToPoint()
. After the user stopped zooming I am triggering a function that calculates the size and zoom from the CSS and applies them to the canvas, this way the canvas is updated and the image is sharp again.Here is the demo: https://codepen.io/Fjonan/pen/JoPJmVr
On my desktop device this code works as expected. However on mobile it freezes the browser for multiple minutes. I used remote debugging to look into what is happening and it looks like
requestRenderAll
triggersrenderAndReset
multiple timesScreenshot from a performance recording - every red rectangle is a
renderAndReset
call.This is from desktop, 20x slowdown and the
renderAndReset
is fired once and took ~4 secondsAs I understand
requestRenderAll
this should not be possible to happen and I don't understand why the exact same code behaves so differently.In both cases - mouse wheel and pinch -
1000 ms
after the user stopped zooming this function is executed, migrating thetransform: scale()
to a new canvas size and zoom:Error Message & Stack Trace
No response
Beta Was this translation helpful? Give feedback.
All reactions