Added token moving and removing on map

This commit is contained in:
Mitchell McCaffrey
2020-03-20 13:33:12 +11:00
parent 1133fe2d2b
commit 82d750eca7
6 changed files with 105 additions and 44 deletions
+6 -4
View File
@@ -67,12 +67,14 @@ function ProxyToken({ tokenClassName, onProxyDragEnd }) {
let proxy = imageRef.current;
if (proxy) {
if (onProxyDragEnd) {
const endX = parseFloat(proxy.getAttribute("data-x")) || 0;
const endY = parseFloat(proxy.getAttribute("data-y")) || 0;
const x = parseFloat(proxy.getAttribute("data-x")) || 0;
const y = parseFloat(proxy.getAttribute("data-y")) || 0;
const id = target.getAttribute("data-token-id");
onProxyDragEnd(proxyOnMap.current, {
image: imageSource,
x: endX,
y: endY
x,
y,
id
});
}