diff --git a/editor/js/ui/palette.js b/editor/js/ui/palette.js index e38c1d8b8..a1d130adf 100644 --- a/editor/js/ui/palette.js +++ b/editor/js/ui/palette.js @@ -233,17 +233,25 @@ RED.palette = (function() { if (!spliceTimer) { spliceTimer = setTimeout(function() { - - var svgRect = chartSVG.createSVGRect(); - svgRect.x = mouseX; - svgRect.y = mouseY; - svgRect.width = 1; - svgRect.height = 1; + var nodes = []; var bestDistance = Infinity; var bestLink = null; - var nodes = chartSVG.getIntersectionList(svgRect,chartSVG); - mouseX /= RED.view.scale(); - mouseY /= RED.view.scale(); + if (chartSVG.getIntersectionList) { + var svgRect = chartSVG.createSVGRect(); + svgRect.x = mouseX; + svgRect.y = mouseY; + svgRect.width = 1; + svgRect.height = 1; + nodes = chartSVG.getIntersectionList(svgRect,chartSVG); + mouseX /= RED.view.scale(); + mouseY /= RED.view.scale(); + } else { + // Firefox doesn't do getIntersectionList and that + // makes us sad + mouseX /= RED.view.scale(); + mouseY /= RED.view.scale(); + nodes = RED.view.getLinksAtPoint(mouseX,mouseY); + } for (var i=0;i= bb.x && y >= bb.y && x <= bb.x+bb.width && y <= bb.y+bb.height) { + result.push(links[i]) + } + } + return result; } }; })();