From c9077304c8188b4a29b8f8682219d5887a42da98 Mon Sep 17 00:00:00 2001 From: Mark MacKay Date: Fri, 1 Jan 2021 13:56:30 -0600 Subject: [PATCH] adding bug note --- src/js/svgcanvas.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/svgcanvas.js b/src/js/svgcanvas.js index 03eadbe..2cb04ed 100644 --- a/src/js/svgcanvas.js +++ b/src/js/svgcanvas.js @@ -2155,14 +2155,15 @@ var addToSelection = this.addToSelection = function(elemsToAdd, showGrips) { } } call("selected", selectedElements); - selectorManager.requestSelector(selectedElements[0]).showGrips(showGrips) + // todo Bug: if duplicated with shift it will deselect and cause an error + if (selectedElements[0]) selectorManager.requestSelector(selectedElements[0]).showGrips(showGrips) // make sure the elements are in the correct order // See: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-compareDocumentPosition selectedElements.sort(function(a,b) { if(a && b && a.compareDocumentPosition) { - return 3 - (b.compareDocumentPosition(a) & 6); + return 3 - (b.compareDocum`entPosition(a) & 6); } else if(a == null) { return 1; }