Fix Issue 192: broken while working on the zoom feature

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@630 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2009-09-13 04:09:33 +00:00
parent 922b8c65ca
commit 14725fb8bf
1 changed files with 8 additions and 4 deletions

View File

@ -3243,8 +3243,11 @@ function BatchCommand(text) {
this.moveSelectedElements = function(dx,dy,undoable) {
// if undoable is not sent, default to true
dx *= current_zoom;
dy *= current_zoom;
// if single values, scale them to the zoom
if (dx.constructor != Array) {
dx *= current_zoom;
dy *= current_zoom;
}
var undoable = undoable || true;
var batchCmd = new BatchCommand("position");
var i = selectedElements.length;
@ -3254,12 +3257,12 @@ function BatchCommand(text) {
selectedBBoxes[i] = this.getBBox(selected);
// dx and dy could be arrays
if (dx.constructor == Array) {
selectedBBoxes[i].x += dx[i];
selectedBBoxes[i].x += dx[i] * current_zoom;
} else {
selectedBBoxes[i].x += dx;
}
if (dy.constructor == Array) {
selectedBBoxes[i].y += dy[i];
selectedBBoxes[i].y += dy[i] * current_zoom;
} else {
selectedBBoxes[i].y += dy;
}
@ -3511,6 +3514,7 @@ function BatchCommand(text) {
this.moveSelectedElements(dx,dy);
};
this.getCurrentZoom = function() { return this.current_zoom; }
}
// Static class for various utility functions