BUG (and solution): canvas is duplicated on Android 4.1.1 (default Browser) when orientantion change

已查看 2,936 次
跳至第一个未读帖子

Fabio Biondi

未读,
2013年1月12日 19:33:452013/1/12
收件人 createjs-...@googlegroups.com
Hi guys,
some weeks ago I notified you a bug on Android 4.1.x default browser:

Now another bug: when I change orientation the Canvas is duplicated creating a lot of problems,
I found some info here:
and here:

To fix this issue there are many ways: in my case I have removed "overflow:hidden" from my body and everything magically works.
I'm still debugging right now but it seems that the double click issue of my previous post is fixed too.

Hope it's useful : )
Fabio


Fabio Biondi

未读,
2013年1月13日 19:43:272013/1/13
收件人 createjs-...@googlegroups.com
Update:
I'm sorry but the fix above doesn't work and I have tried a lot of other ways with no results. The bug always happens.

I spent hours to debug this issue (and many other people got it) and here my results:

1) the problem is only on Android 4.1.x and 4.2 using the default browser (on tablets and smartphones). Chrome works well.
2) When I rotate the Android device it seems the stage is not cleared  so I have duplicated stuff.
It happens when I change the canvas size (i.e. canvas.width = XXX).
3) I have also tried to manually clear the stage after the orientantion change using stage.clear() or the standard canvas sintax (clearRect(x,y,w,h). Nothing!

The only workaround I really found to avoid this strange behaviors was forcing to refresh the whole page when the device is rotated (on Android devices, OS >= 3, default browser).
It's not a real solution but at least users won't see weird stuff on their screen.

Fabio



Radek Bartoň

未读,
2013年4月9日 18:17:492013/4/9
收件人 createjs-...@googlegroups.com
I think it is related to issue with setInterval() [1]. For some reason Android WebView can't clear canvas from asynchonous functions. Is it possible to call (queue for calling) a function on WebView main thread from asynchronous function?

[1] http://code.google.com/p/android/issues/detail?id=37529


Максим Зубков

未读,
2013年10月31日 12:57:512013/10/31
收件人 createjs-...@googlegroups.com
I don't think this is related to timeouts, it's just that everyone uses timeouts with canvas :) The same (I guess) issue here code.google.com/p/android/issues/detail?id=35474 has ugly but working workaround with opacity.

Felix Zhou

未读,
2018年4月10日 06:51:042018/4/10
收件人 CreateJS Discussion
It's great help for me. saved my day!!!
回复全部
回复作者
转发
0 个新帖子