Made zoom work on Shift+mousewheel (fails in Opera), made zoom out work on Shift+click in zoom mode

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@884 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Alexis Deveria
2009-10-28 18:04:38 +00:00
parent 21820931c1
commit a7b3b7dd25
2 changed files with 36 additions and 3 deletions

View File

@@ -2970,11 +2970,13 @@ function BatchCommand(text) {
if (rubberBox != null) {
rubberBox.setAttribute("display", "none");
}
var factor = evt.shiftKey?.5:2;
call("zoomed", {
'x': Math.min(start_x,x),
'y': Math.min(start_y,y),
'width': Math.abs(x-start_x),
'height': Math.abs(y-start_y)
'height': Math.abs(y-start_y),
'factor': factor
});
return;
case "fhpath":
@@ -4097,7 +4099,7 @@ function BatchCommand(text) {
if(typeof val == 'object') {
bb = val;
if(bb.width == 0 || bb.height == 0) {
canvas.setZoom(current_zoom * 2);
canvas.setZoom(current_zoom * bb.factor);
return {'zoom': current_zoom, 'bbox': bb};
}
return calcZoom(bb);