Fixed alignment tools

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@935 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2009-11-12 18:38:13 +00:00
parent 2a33e25dce
commit 38242ad3d6
1 changed files with 11 additions and 5 deletions

View File

@ -5444,17 +5444,23 @@ function BatchCommand(text) {
var selected = selectedElements[i];
if (selected != null) {
selectedBBoxes[i] = this.getBBox(selected);
var xform = svgroot.createSVGTransform();
var tlist = canvas.getTransformList(selected);
// dx and dy could be arrays
if (dx.constructor == Array) {
selectedBBoxes[i].x += dx[i];
selectedBBoxes[i].y += dy[i];
xform.setTranslate(dx[i],dy[i]);
} else {
selectedBBoxes[i].x += dx;
}
if (dy.constructor == Array) {
selectedBBoxes[i].y += dy[i];
} else {
selectedBBoxes[i].y += dy;
xform.setTranslate(dx,dy);
}
tlist.appendItem(xform);
var cmd = recalculateDimensions(selected);//,selectedBBoxes[i]);
if (cmd) {
batchCmd.addSubCommand(cmd);
@ -5716,7 +5722,7 @@ function BatchCommand(text) {
for (var i = 0; i < len; ++i) {
if (selectedElements[i] == null) break;
var elem = selectedElements[i];
bboxes[i] = canvas.getStrokedBBox(elem);
bboxes[i] = canvas.getStrokedBBox([elem]);
// now bbox is axis-aligned and handles rotation
switch (relative_to) {