konvajs / konva

Konva.js is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.
http://konvajs.org/
Other
11.07k stars 896 forks source link

flipEnabled =false in transformer not working??? #1771

Closed prosagar-ggs closed 4 weeks ago

prosagar-ggs commented 1 month ago

Thank you for submitting an issue!

Please make sure to check current open and closed issues to see if your question has been asked or answered before. If you have just a question (not a bug or a feature request) it is better to ask it in Stackoverflow.

If you have a bug, please, try to create a reproducible example with jsfiddle (or any similar service). You can use this JSBIN as a template.

prosagar-ggs commented 1 month ago

I am working with konva for quite some weeks now.

I do have an issue while trying to mirror an image. Setting scaleX is working as expected, and it is mirrored on the vertical axis.

Moreover, I do have an issue (either a bug or understanding) with a transformer that I want to attack to the node. I create it after the image, meaning the flipping is already in place. But the rotation anchor is set down of the image, and not top of the image as usual.

Is there a workaround to this?

Here are examples of what I do in my code concerning the transformer:

const transformer = new Konva.Transformer({ nodes: [image], flipEnabled: false, rotateEnabled: true, enabledAnchors: ["top-left", "top-right", "bottom-left", "bottom-right", "top-center", "middle-left", "middle-right", "bottom-center"], });

lavrton commented 4 weeks ago

https://stackoverflow.com/a/78592978/512042