moveable
moveable copied to clipboard
Is there a way to get the properties for an svg element from the events?
I need to get the correct properties like the new left and top values, are those part of the events or do I need to calculate based on the ratio between the svg size and the page?
Hi @isaacfink, have you been able to figure this out? Maybe if you can mention precisely what event are you listening to but this is how I am managing mine, I am using transform, and there's also drag where you can get your top and left offsets.
onDrag={(e) => {
e.target.style.transform = e.transform;
const blockId = e.target.getAttribute('data-id');
if (!blockId) return;
const { x, y, rotate } = parseTransform(e.transform);
}}