konvajs / react-konva

React + Canvas = Love. JavaScript library for drawing complex canvas graphics using React.
https://konvajs.github.io/docs/react/
MIT License
5.8k stars 260 forks source link

Positioning issue with transformer using keepRatio prop set to false #798

Open fredrik-bravo opened 8 months ago

fredrik-bravo commented 8 months ago

The position is changing slightly when transforming and moving past the anchored corner. This can be exaggerated by dragging a corner of a rect around the anchored corner. This issue seems to be specific to react-konva as I can't reproduce it with pure konva.js and only happens when I set the prop keepRatio to false.

Here is a codepen with the described issue: https://codesandbox.io/p/sandbox/green-morning-rp3hct?file=%2Fsrc%2FApp.js

Video showing the issue

lavrton commented 8 months ago

It looks like it is an effect of boundBoxFunc that you have. There are no issues without it. But I am not sure yet how to update it better.