wanadev / perspective.js

Transforms the perspective of an image and draw it on a canvas
Apache License 2.0
136 stars 27 forks source link

Clearing active canvas problem #9

Closed alexzakarov closed 3 years ago

alexzakarov commented 3 years ago

When I try to draw an image on my canvas, It immediately clears all the things on my canvas and after draws the image, I tried to find the source of the problem by the way I remove this line of code and it works now.

this._applyMask(this.p.ctxd, [[d0x, d0y], [d1x, d1y], [d2x, d2y], [d3x, d3y]]);

flozz commented 3 years ago

Hello,

I was able to reproduce: https://jsfiddle.net/7s90jfkg/1/

I will try to take some time later this week or next week to work on it (I have to understand why there were a mask at first place, etc.)

Thank you for your report :)

alexzakarov commented 3 years ago

I have used your demo file to try and downloaded the "perspective.js" file again to control everything is fine or not, but after more than 10 trials, the problem still exists.

Thanks for your quick return, I have not been waiting :)

flozz commented 3 years ago

As webkit has now antialiasing on clip path, I reverted the lib to use a clip path instead of a mask.

The fix was released in perspectivejs v1.0.3 and was published on NPM :)