daybrush / moveable

Moveable! Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable! Groupable! Snappable!
https://daybrush.com/moveable/
MIT License
10.08k stars 618 forks source link

Wrong bounds position when changing scale, css positioning, transform-origin #699

Closed mdominiak2 closed 2 years ago

mdominiak2 commented 2 years ago

Environments

Description

Moveable allows to move an element out of the container. The problem also occurs without transform: scale. Any advice?

image

mdominiak2 commented 2 years ago

I think I solved the problem by adding a container with a specific css style.

But still there are some imperfections when I change transform-origin to center

https://codesandbox.io/s/magical-mirzakhani-b17ts7?file=/index.html

image

mdominiak2 commented 2 years ago

If I avoid using display: flex and transform-origin: center everything is ok. But when I want to center the drag area, I get the same bug again.

https://codesandbox.io/s/gifted-matsumoto-7zhe67?file=/src/styles.css

image

daybrush commented 2 years ago

@mdominiak2

moveable's new version is released. Check it again.

It may not be perfect, but it has improved the accuracy a lot.

mdominiak2 commented 2 years ago

Thanks. Great job.