wScratchPad icon indicating copy to clipboard operation
wScratchPad copied to clipboard

Not working on Android 4.2 , some suggests

Open websiteflash opened this issue 11 years ago • 14 comments

there are some bug with canvas when set content.globalCompositeOperation 'destination-out' on android 4.2. browser does not change the view when we arc or move on the canvas with an alpha color. so i have to change the style of the canvas to make browser redraw after scratchDown scratchMove and scratchUp. i hope u can find a good way to fix this bug,thx.

i do like this: $this.canvas.css('margin-right', 0px or 1px)// change the margin right in 0px and 1px

other, the wScratchPad does not work with zepto, can we make some change to support it.

websiteflash avatar Jun 07 '13 16:06 websiteflash

I'll try looking into it soon, just updating the blog at the moment. On Jun 7, 2013 11:49 PM, "websiteflash" [email protected] wrote:

there are some bug with canvas when set content.globalCompositeOperation 'destination-out' on android 4.2. browser does not change the view when we arc or move on the canvas with an alpha color. so i have to change the style of the canvas to make browser redraw after scratchDown scratchMove and scratchUp. i hope u can find a good way to fix this bug,thx.

i do like this: $this.canvas.css('margin-right', 0px or 1px)// change the margin right in 0px and 1px

other, the wScratchPad does not work with zepto, can we make some change to support it.

— Reply to this email directly or view it on GitHubhttps://github.com/websanova/wScratchPad/issues/15 .

websanova avatar Jun 08 '13 01:06 websanova

I am having the same issue on Android 4.2.2. Did you find a fix for this bug ? Thanks.

amseddi avatar Aug 04 '13 19:08 amseddi

Added jquery.mobile-1.2.0.min.js will fix this bug.

liangwenke avatar Aug 19 '13 07:08 liangwenke

Fixed double reload page need add "data-role" attribute:

liangwenke avatar Aug 19 '13 07:08 liangwenke

I am having trouble getting this to work on Samsung Galaxy S3. Any pointers?

Thanks!

gxlbox avatar Oct 09 '13 13:10 gxlbox

I am also having trouble with this plugin. I found that the changedTouches in touchmove event could be null on some android webview. So I fixed it in this way;

$el.bind('touchstart touchmove touchend touchcancel', function (event) { var touches = event.changedTouches; if (event.changedTouches == null) { touches = event.originalEvent.targetTouches; } var first = touches[0], type = "" blahblah }

Then, the browser still not change when I touch it, and i tried this to redraw the view. $($this.canvas).css('margin-right',Math.random()+'px'); // I don't know why 0px did not work and this is not a good way.

This is not the end. Another issue came out that the callback function didn't work!!

Anyone know why?

kulang21 avatar Dec 10 '13 14:12 kulang21

Similar redraw problem occurred to me, but in my case, only some of the HTC's newer models won't work (eg: butterfly and one, we found so far). I (kind of) solved it by set 'realtimePercent' to true. (HTC One works, but still no use in butterfly).

mutekinootoko avatar Feb 19 '14 08:02 mutekinootoko

Any news about this bug? I can scratch when i use this code: $(this.canvas).css('margin-right', $(this.canvas).css('margin-right') == "0px" ? "1px" : "0px");

Its not a proper fix, feels laggy. Hope u have a fix for it very soon ;)

Great work on the plugin.

jacoweb avatar Apr 02 '14 21:04 jacoweb

try using new 2.0.0 version and see if there are still issues.

websanova avatar Apr 05 '14 23:04 websanova

I find out that perhaps it's the globalCompositeOperation attribute of canvas that makes the plugin not working on the Android 4.2. Some browsers don't fully support this attributes.

Edward1992 avatar Apr 28 '14 06:04 Edward1992

2.0.0 still does not work in opera and firefox.

domyway avatar Jun 01 '14 12:06 domyway

@kulang21 try this out: touches = (event.originalEvent.changedTouches || event.originalEvent.targetTouches) It works for me. By the way, there are still some scaling cavas image problem in some device. Any one fix that?

sy-tang avatar Jun 25 '14 10:06 sy-tang

I tried Android 4.2.2 Browser and nothing scratched off, still.

clippit avatar Jul 30 '14 12:07 clippit

2.0.0 still does not work on Android 4.1 - 4.3

wzw1990 avatar Sep 23 '14 06:09 wzw1990