Move normalization of selected bbox to inside mouseMove to prevent bug when selected box disappears when resizing negatively

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@174 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Jeff Schiller
2009-06-23 05:46:47 +00:00
parent 6ac2227fae
commit cf2a8a9005

View File

@@ -141,15 +141,6 @@ function SvgCanvas(c)
function recalculateSelectedDimensions() {
var box = selected.getBBox();
// normalize selectedBBox
if (selectedBBox.width < 0) {
selectedBBox.x += selectedBBox.width;
selectedBBox.width = -selectedBBox.width;
}
if (selectedBBox.height < 0) {
selectedBBox.y += selectedBBox.height;
selectedBBox.height = -selectedBBox.height;
}
var remapx = function(x) {return ((x-box.x)/box.width)*selectedBBox.width + selectedBBox.x;}
var remapy = function(y) {return ((y-box.y)/box.height)*selectedBBox.height + selectedBBox.y;}
var scalew = function(w) {return w*selectedBBox.width/box.width;}
@@ -549,6 +540,16 @@ function SvgCanvas(c)
selectedBBox.y = top+ty;
selectedBBox.width = width*sx;
selectedBBox.height = height*sy;
// normalize selectedBBox
if (selectedBBox.width < 0) {
selectedBBox.x += selectedBBox.width;
selectedBBox.width = -selectedBBox.width;
}
if (selectedBBox.height < 0) {
selectedBBox.y += selectedBBox.height;
selectedBBox.height = -selectedBBox.height;
}
ts = "translate(" + (left+tx) + "," + (top+ty) + ") scale(" + (sx) + "," + (sy) +
") translate(" + (-left) + "," + (-top) + ")";