Fix Issue 254: Handle Webkit's use of matrix transforms, merging Peter's patch

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@752 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2009-10-02 23:19:11 +00:00
parent 17ab1563d3
commit aacc77b6a6
1 changed files with 5 additions and 0 deletions

View File

@ -3572,6 +3572,11 @@ function BatchCommand(text) {
var xform = tlist.getItem(t); var xform = tlist.getItem(t);
if (xform.type == 4) { if (xform.type == 4) {
return xform.angle; return xform.angle;
} else if (xform.type == 1) {
// Matrix transformation. Extract the rotation. (for Webkit)
var angle = Math.round( Math.acos(xform.matrix.a) * 180.0 / Math.PI );
if (xform.matrix.b < 0) angle = -angle;
return angle;
} }
} }
return 0; return 0;