From 42f620daa2a1048c991594cae1885c81d5ba56ab Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Tue, 21 Jun 2016 15:56:00 -0700 Subject: [PATCH] Check if matrix is null in mouseToSvg --- core/utils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/utils.js b/core/utils.js index 19ccc4cc8..89644fff9 100644 --- a/core/utils.js +++ b/core/utils.js @@ -315,6 +315,10 @@ Blockly.mouseToSvg = function(e, svg, matrix) { var svgPoint = svg.createSVGPoint(); svgPoint.x = e.clientX; svgPoint.y = e.clientY; + + if (!matrix) { + matrix = svg.getScreenCTM().inverse(); + } return svgPoint.matrixTransform(matrix); };