From 12a7d213f2b08cbd5cf9b01bd77e48ac0b610c7a Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Sat, 17 Mar 2018 01:24:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4blockly=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _server/editor_blockly.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/_server/editor_blockly.js b/_server/editor_blockly.js index bbd2be2d..049d0559 100644 --- a/_server/editor_blockly.js +++ b/_server/editor_blockly.js @@ -230,13 +230,14 @@ window.addEventListener('resize', onresize, false); onresize(); Blockly.svgResize(workspace); -//Blockly.bindEventWithChecks_(editor_blockly.workspace.svgGroup_,"wheel",editor_blockly.workspace,function(e){}); +//Blockly.bindEventWithChecks_(workspace.svgGroup_,"wheel",workspace,function(e){}); document.getElementById('blocklyDiv').onmousewheel = function(e){ //console.log(e); e.preventDefault(); var hvScroll = e.shiftKey?'hScroll':'vScroll'; - editor_blockly.workspace.scrollbar[hvScroll].handlePosition_+=( ((e.deltaY||0)+(e.detail||0)) >0?20:-20); - editor_blockly.workspace.scrollbar[hvScroll].onScroll_(); + workspace.scrollbar[hvScroll].handlePosition_+=( ((e.deltaY||0)+(e.detail||0)) <0?20:-20); + workspace.scrollbar[hvScroll].onScroll_(); + workspace.setScale(workspace.scale); } var doubleClickCheck=[[0,'abc']];