added missing base 10 radix
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2389 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
11d58b0ad7
commit
e150132453
|
@ -63,7 +63,7 @@ svgedit.math.isIdentity = function(m) {
|
||||||
// The matrix object resulting from the calculation
|
// The matrix object resulting from the calculation
|
||||||
svgedit.math.matrixMultiply = function() {
|
svgedit.math.matrixMultiply = function() {
|
||||||
var args = arguments, i = args.length, m = args[i-1];
|
var args = arguments, i = args.length, m = args[i-1];
|
||||||
|
|
||||||
while(i-- > 1) {
|
while(i-- > 1) {
|
||||||
var m1 = args[i-1];
|
var m1 = args[i-1];
|
||||||
m = m1.multiply(m);
|
m = m1.multiply(m);
|
||||||
|
@ -74,7 +74,7 @@ svgedit.math.matrixMultiply = function() {
|
||||||
if (Math.abs(m.d) < NEAR_ZERO) m.d = 0;
|
if (Math.abs(m.d) < NEAR_ZERO) m.d = 0;
|
||||||
if (Math.abs(m.e) < NEAR_ZERO) m.e = 0;
|
if (Math.abs(m.e) < NEAR_ZERO) m.e = 0;
|
||||||
if (Math.abs(m.f) < NEAR_ZERO) m.f = 0;
|
if (Math.abs(m.f) < NEAR_ZERO) m.f = 0;
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -166,10 +166,10 @@ svgedit.math.transformListToTransform = function(tlist, min, max) {
|
||||||
// Or should tlist = null have been prevented before this?
|
// Or should tlist = null have been prevented before this?
|
||||||
return svg.createSVGTransformFromMatrix(svg.createSVGMatrix());
|
return svg.createSVGTransformFromMatrix(svg.createSVGMatrix());
|
||||||
}
|
}
|
||||||
var min = min == undefined ? 0 : min;
|
min = min || 0;
|
||||||
var max = max == undefined ? (tlist.numberOfItems-1) : max;
|
max = max || (tlist.numberOfItems - 1);
|
||||||
min = parseInt(min);
|
min = parseInt(min, 10);
|
||||||
max = parseInt(max);
|
max = parseInt(max, 10);
|
||||||
if (min > max) { var temp = max; max = min; min = temp; }
|
if (min > max) { var temp = max; max = min; min = temp; }
|
||||||
var m = svg.createSVGMatrix();
|
var m = svg.createSVGMatrix();
|
||||||
for (var i = min; i <= max; ++i) {
|
for (var i = min; i <= max; ++i) {
|
||||||
|
@ -219,7 +219,7 @@ svgedit.math.snapToAngle = function(x1,y1,x2,y2) {
|
||||||
var angle = Math.atan2(dy,dx);
|
var angle = Math.atan2(dy,dx);
|
||||||
var dist = Math.sqrt(dx * dx + dy * dy);
|
var dist = Math.sqrt(dx * dx + dy * dy);
|
||||||
var snapangle= Math.round(angle/snap)*snap;
|
var snapangle= Math.round(angle/snap)*snap;
|
||||||
var x = x1 + dist*Math.cos(snapangle);
|
var x = x1 + dist*Math.cos(snapangle);
|
||||||
var y = y1 + dist*Math.sin(snapangle);
|
var y = y1 + dist*Math.sin(snapangle);
|
||||||
//console.log(x1,y1,x2,y2,x,y,angle)
|
//console.log(x1,y1,x2,y2,x,y,angle)
|
||||||
return {x:x, y:y, a:snapangle};
|
return {x:x, y:y, a:snapangle};
|
||||||
|
@ -242,5 +242,4 @@ svgedit.math.rectsIntersect = function(r1, r2) {
|
||||||
(r2.y+r2.height) > r1.y;
|
(r2.y+r2.height) > r1.y;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
})();
|
})();
|
Loading…
Reference in New Issue