fix issue on selection with no parent

master
JFH 2021-05-24 10:07:01 +02:00
parent 8ffe894047
commit a55ecfe244
1 changed files with 1 additions and 12 deletions

View File

@ -162,21 +162,10 @@ export const getMouseTargetMethod = function (evt) {
return selectionContext_.getCanvas().selectorManager.selectorParentGroup; return selectionContext_.getCanvas().selectorManager.selectorParentGroup;
} }
while (!mouseTarget.parentNode.isSameNode(selectionContext_.getCurrentGroup() || currentLayer)) { while (!mouseTarget.parentNode?.isSameNode(selectionContext_.getCurrentGroup() || currentLayer)) {
mouseTarget = mouseTarget.parentNode; mouseTarget = mouseTarget.parentNode;
} }
//
// // go up until we hit a child of a layer
// while (mouseTarget.parentNode.parentNode.tagName == 'g') {
// mouseTarget = mouseTarget.parentNode;
// }
// Webkit bubbles the mouse event all the way up to the div, so we
// set the mouseTarget to the svgroot like the other browsers
// if (mouseTarget.nodeName.toLowerCase() == 'div') {
// mouseTarget = svgroot;
// }
return mouseTarget; return mouseTarget;
}; };
/** /**