daybrush / moveable

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

Moveable Transform onDrag #270

Open nosajthenitram opened 4 years ago

nosajthenitram commented 4 years ago

I'm trying to get the offset of an element within the bounds of another element. As I move the element around in the box, the transform is all over the place, calculating the relative offset to the last click. The one value that looks like the one that I want is the transform of the moveablve-control-box, as it contains the proper offset. When I assign target.style.transform = transform in my onDrag function, it does not take on this value from the moveable-control-box. Where is this value coming from? How can I easily get the transform from the moveable-control-box as my final placement?

daybrush commented 4 years ago

@nosajthenitram

Are you looking for this?

movable.getRect()