fabricjs / fabric.js

Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser
http://fabricjs.com
Other
29.07k stars 3.51k forks source link

pinch image/ text and rotate scale have strange behaviour. #6599

Open dani26381 opened 4 years ago

dani26381 commented 4 years ago

Version

4.10 3.6.6

Test Case

http://fabricjs.com/touch-events

Which browsers?

Steps to reproduce

Trying to pinch a image or a text (chrome and firefox / android), etc to rotate or scale, and have a very strange behaviour. Doesn't happen with fabricjs 3.0 but with 3.6.6 and 4.1.0 versions pinch rotation have a very strange behaviour when rotation, like not centered and not predecible rotation.

Is like when rotating, doesn't maintain the center and in every move, it changes and in 2/3 pinch/rotate the objects it is not controllable.

asturur commented 4 years ago

our gesture integration isn't great. Way better to handle it with hammerJS in my opinion.

dani26381 commented 4 years ago

In fabric.js version 3.0.0 gestures work perfect! maybe some change in later versions?

btw Great job with fabricjs :)

dani26381 commented 4 years ago

I dont know if you see it. But in fabric 3.0 gestures work perfect, maybe a change in later versions?

I think this functionality is very important, to make responsive apps.

Thanks!

asturur commented 4 years ago

how does responsive relate to touch actions?

dani26381 commented 4 years ago

I mean responsive, about use fabricjs on smartphones/ tablets is very useful to use "gestures", to rotate or resize elements etc..

johannbuscail commented 3 years ago

@asturur any update on this ? It's now Fabric v4 and the touch support is still horrible. I'm testing it on Surface and IPad Pro. It's a really requested feature by the users of my app.

yanyi24 commented 2 years ago

@asturur Hello, my fabric-with-gestures is v4.5.0. My code works perfectly when the phone is in portrait, but in landscape an error occurs when I pinch the picture with two fingers. I'm guessing something is wrong with this code: 'scale += distance / start.distance;' Problems arise when screen aspect ratio changes.

gloriousjob commented 2 years ago

@yanyi24 I wonder if this fix pertains to what you're referring to: https://github.com/fabricjs/fabric.js/commit/9d8fce4a568efc1dafabaceb69017aba30777453