diff --git a/expertWires.js b/expertWires.js index ecf0dbe..fcbf71d 100644 --- a/expertWires.js +++ b/expertWires.js @@ -37,7 +37,7 @@ var labelThese=[]; // overlay - a red/white transparency to show logic high or low // hilite - to show the selected polygon // hitbuffer - abusing color values to return which polygon is under a point -// we no longer use a scaling transform - we now scale the chip data at +// we no longer use a scaling transform - we now scale the chip data at // the point of drawing line segments // if the canvas is any smaller than chip coordinates there will be // rounding artifacts, and at high zoom there will be anti-aliasing on edges. @@ -53,7 +53,7 @@ var layernames = ['metal', 'switched diffusion', 'inputdiode', 'grounded diffusi var colors = ['rgba(128,128,192,0.4)','#FFFF00','#FF00FF','#4DFF4D', '#FF4D4D','#801AC0','rgba(128,0,255,0.75)']; var drawlayers = [true, true, true, true, true, true]; - + // some modes and parameters which can be passed in from the URL query var moveHereFirst; var expertMode=true; @@ -277,13 +277,22 @@ function handleKey(e){ else if(c=='p') stepBack(); } +// handler for zoom in/out using the mouse wheel +function handleWheelZoom(e){ + chipsurround.focus(); + e.preventDefault(); + var n = e.deltaY / 100; + if(n>0 && zoom>1) setZoom(zoom/1.2); + if(n<0 && zoom