commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbe...@apache.org
Subject svn commit: r984039 - /commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml
Date Tue, 10 Aug 2010 14:20:49 GMT
Author: jbeard
Date: Tue Aug 10 14:20:49 2010
New Revision: 984039

URL: http://svn.apache.org/viewvc?rev=984039&view=rev
Log:
Fixed issue involving repositioning scale and rotate handles.

Modified:
    commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml?rev=984039&r1=984038&r2=984039&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml Tue Aug
10 14:20:49 2010
@@ -82,18 +82,14 @@ In both:
 			var sePtX = cachedBBox.width + cachedBBox.x;
 			var sePtY = cachedBBox.height + cachedBBox.y;
 
+			//TODO: make this more general
 			var sScale = scaleHandle.transform.baseVal.getItem(0);
-			var bbox = scaleHandle.getBBox();
-			var dx = sePtX - bbox.x;
-			var dy = sePtY - bbox.y;
-			var newM = scaleHandle.ownerSVGElement.createSVGMatrix().translate(dx,dy).multiply(sScale.matrix);
+			var newM = scaleHandle.ownerSVGElement.createSVGMatrix().translate(sePtX,sePtY).
+					multiply(scaleHandle.ownerSVGElement.createSVGMatrix().rotate(-45));
 			sScale.setMatrix(newM);
 
 			var rScale = rotationHandle.transform.baseVal.getItem(0);
-			var bbox = rotationHandle.getBBox();
-			var dx = sePtX - bbox.x;
-			var dy = sePtY - bbox.y;
-			var newM = rotationHandle.ownerSVGElement.createSVGMatrix().translate(dx,dy).multiply(rScale.matrix);
+			var newM = rotationHandle.ownerSVGElement.createSVGMatrix().translate(sePtX,sePtY);
 			rScale.setMatrix(newM);
 		}
 



Mime
View raw message