ctrl+click doesn't zoom awkwardly

This commit is contained in:
Connor Turland 2014-11-29 16:05:56 -05:00
parent 93227f0e2f
commit 694d36b6a6

View file

@ -380,11 +380,21 @@ Metamaps.JIT = {
if(e.ctrlKey){
Metamaps.Visualize.mGraph.busy = false;
Metamaps.Mouse.boxEndCoordinates = eventInfo.getPos();
var bS = Metamaps.Mouse.boxStartCoordinates;
var bE = Metamaps.Mouse.boxEndCoordinates;
if (Math.abs(bS.x - bE.x) > 20 && Math.abs(bS.y - bE.y) > 20) {
Metamaps.JIT.zoomToBox(e);
//console.log('called zoom to box');
return;
}
else if (e.shiftKey) {
else {
Metamaps.Mouse.boxStartCoordinates = null;
Metamaps.Mouse.boxEndCoordinates = null;
}
//console.log('called zoom to box');
}
if (e.shiftKey) {
Metamaps.Visualize.mGraph.busy = false;
Metamaps.Mouse.boxEndCoordinates = eventInfo.getPos();
Metamaps.JIT.selectWithBox(e);