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:
@@ -141,15 +141,6 @@ function SvgCanvas(c)
|
|||||||
|
|
||||||
function recalculateSelectedDimensions() {
|
function recalculateSelectedDimensions() {
|
||||||
var box = selected.getBBox();
|
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 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 remapy = function(y) {return ((y-box.y)/box.height)*selectedBBox.height + selectedBBox.y;}
|
||||||
var scalew = function(w) {return w*selectedBBox.width/box.width;}
|
var scalew = function(w) {return w*selectedBBox.width/box.width;}
|
||||||
@@ -549,6 +540,16 @@ function SvgCanvas(c)
|
|||||||
selectedBBox.y = top+ty;
|
selectedBBox.y = top+ty;
|
||||||
selectedBBox.width = width*sx;
|
selectedBBox.width = width*sx;
|
||||||
selectedBBox.height = height*sy;
|
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) +
|
ts = "translate(" + (left+tx) + "," + (top+ty) + ") scale(" + (sx) + "," + (sy) +
|
||||||
") translate(" + (-left) + "," + (-top) + ")";
|
") translate(" + (-left) + "," + (-top) + ")";
|
||||||
|
|||||||
Reference in New Issue
Block a user