fixed getRefElem and smoothControlPoints leaking variables

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2402 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Bruno Heridet
2013-02-15 23:05:23 +00:00
parent d5dca6b4a3
commit 7a36f90eb6
5 changed files with 65 additions and 81 deletions

View File

@@ -225,17 +225,16 @@ svgedit.units.convertToNum = function(attr, val) {
if (wAttrs.indexOf(attr) >= 0) {
return num * width;
} else if (hAttrs.indexOf(attr) >= 0) {
return num * height;
} else {
return num * Math.sqrt((width*width) + (height*height))/Math.sqrt(2);
}
} else {
var unit = val.substr(-2);
var num = val.substr(0, val.length-2);
// Note that this multiplication turns the string into a number
return num * typeMap_[unit];
if (hAttrs.indexOf(attr) >= 0) {
return num * height;
}
return num * Math.sqrt((width*width) + (height*height))/Math.sqrt(2);
}
var unit = val.substr(-2);
var num = val.substr(0, val.length-2);
// Note that this multiplication turns the string into a number
return num * typeMap_[unit];
};
// Function: svgedit.units.isValidUnit