Added check for stage in drag overlay
This commit is contained in:
parent
eb0826d48c
commit
fd9f47e41e
@ -16,8 +16,11 @@ function DragOverlay({ dragging, node, onRemove }) {
|
|||||||
if (!node || !dragging || !removeTokenRef.current) {
|
if (!node || !dragging || !removeTokenRef.current) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const stage = node.getStage();
|
||||||
const pointerPosition = node.getStage().getPointerPosition();
|
if (!stage) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const pointerPosition = stage.getPointerPosition();
|
||||||
const screenSpacePointerPosition = {
|
const screenSpacePointerPosition = {
|
||||||
x: pointerPosition.x + mapRect.left,
|
x: pointerPosition.x + mapRect.left,
|
||||||
y: pointerPosition.y + mapRect.top,
|
y: pointerPosition.y + mapRect.top,
|
||||||
|
Loading…
Reference in New Issue
Block a user