websanova / wScratchPad

jQuery Scratch Pad Plugin
http://www.websanova.com/plugins/websanova/scratchpad
388 stars 176 forks source link

Not working on Android 4.2 , some suggests #15

Open websiteflash opened 11 years ago

websiteflash commented 11 years ago

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.

websanova commented 11 years ago

I'll try looking into it soon, just updating the blog at the moment. On Jun 7, 2013 11:49 PM, "websiteflash" notifications@github.com 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 .

amseddi commented 11 years ago

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

liangwenke commented 11 years ago

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

liangwenke commented 11 years ago

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

gxlbox commented 11 years ago

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

Thanks!

kulang21 commented 10 years ago

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?

mutekinootoko commented 10 years ago

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).

jacoweb commented 10 years ago

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.

websanova commented 10 years ago

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

Edward1992 commented 10 years ago

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.

domyway commented 10 years ago

2.0.0 still does not work in opera and firefox.

sy-tang commented 10 years ago

@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?

clippit commented 10 years ago

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

wzw1990 commented 10 years ago

2.0.0 still does not work on Android 4.1 - 4.3