From aacc77b6a63fe40251d9977664ff71352cb46428 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Fri, 2 Oct 2009 23:19:11 +0000 Subject: [PATCH] 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 --- editor/svgcanvas.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index d06f5a09..bf578364 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -3572,6 +3572,11 @@ function BatchCommand(text) { var xform = tlist.getItem(t); if (xform.type == 4) { 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;