Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Canvas globalCompositeOperation issue on Samsung galaxy s3 4.1.1 & 4.1.2

I'm trying to create a small drawing application for android browsers. However I've got issues when trying to erase a bitmap using globalCompositeOperation = "destination-out", it simply does not work on the Samsung Galaxy S3

The exact same code works fine on the HTC ONE X with android 4.1.1

I've found a similar issue here http://code.google.com/p/android/issues/detail?id=39183 but no solution. The example behaves exactly as my code on SGS3 and ONEx

Any idea what could be wrong? is it a SGS3 only issue?

like image 745
Andreas Avatar asked Dec 06 '25 06:12

Andreas


1 Answers

I meet it too, but when i use toDataURL, the image i got is right. it maybe because the browser does not render the canvas at the moment, so i change the css, change its margin-right in 0px and 1px,then it work.

$(this.canvas).css('margin-right', $(this.canvas).css('margin-right') == "0px" ? "1px" : "0px");
like image 92
delsen_web Avatar answered Dec 07 '25 20:12

delsen_web



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!