From 575b71246250d49c467ced08f4888fd72eae3ab2 Mon Sep 17 00:00:00 2001 From: Winston Date: Thu, 20 Aug 2015 15:18:58 -0700 Subject: [PATCH] fix: https://github.com/google/blockly/issues/161 On iOS, if I use a pinch gesture in the workspace, these errors appear in the console: Error: Invalid value for attribute x="NaN" --- core/blockly.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/blockly.js b/core/blockly.js index 883bba13f..ab56ed941 100644 --- a/core/blockly.js +++ b/core/blockly.js @@ -294,6 +294,9 @@ Blockly.onMouseUp_ = function(e) { * @private */ Blockly.onMouseMove_ = function(e) { + if (event.touches && event.touches.length >= 2) { + return // multi-touch gestures won't have e.clientX + } var workspace = Blockly.getMainWorkspace(); if (workspace.isScrolling) { Blockly.removeAllRanges();