Closed alfredtan closed 5 years ago
I'd be interested in any response to this issue, as I see choppiness sometimes too.
I tested the animation on Ubuntu with Chromium and can see the same thing - jerky when height is 205, but smooth when height is 206.
It looks like Chome automatically hardware-accelerates larger canvases, but not small ones. https://stackoverflow.com/questions/44323932/no-subpixel-positioning-on-small-html5-canvas-on-chrome
There is a workaround in the StackOverflow post to scale images a little, which forces the browser to hardware-accelerate them. I added this line to your choppy-animation.js
, and it solved the issue in Chrome:
this.instance = new lib.test(); // <-- Line 20
this.instance.scaleX = this.instance.scaleY = 0.99; // <-- New code
I am not sure there is anything we can do about this on the library-level, since its a browser behaviour.
Cheers.
This is very useful for us for the future. Thank you.
Issue Details
Version used (Ex; 1.0): 2015-11-26
We are using Adobe Animate CC (2018) to develop a small banner (320x50) and the animation has an image panning slowly, and we found that on Chrome (69), the animation is really choppy compared to Firefox and Safari (all tested on Mac Sierra). We noticed it has something to do with the stage area (width multiply height).
We've created a sample animation that you can download here - choppy-animation.zip
Open index.html and notice the animation is choppy on Chrome. Open the .js file and change the 'height' value on line 48 to "206", the animation is now smooth on Chrome. When the animation is slow, the overall dimension is 320x205 = 65,600. we've tried different dimensions and if the area is below 65,600 (approximately), it's choppy... not sure if this means anything!
OS & Browser version (Please be specific) (Ex; Windows 10 Home, Chrome 62.0.3202.94): macOS Sierra 10.12.16 Chrome 69.0.3497.100 Firefox 62.0.3 Safari 12.0 (12606.2.11)
Do you know of any workarounds? No.
Greatly appreciate it if there is workaround that we can apply manually so that we can complete this banner.
Thanks