commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbe...@apache.org
Subject svn commit: r984043 - in /commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool: behaviour/canvas.xml build.sh transform.js
Date Tue, 10 Aug 2010 14:21:25 GMT
Author: jbeard
Date: Tue Aug 10 14:21:25 2010
New Revision: 984043

URL: http://svn.apache.org/viewvc?rev=984043&view=rev
Log:
Everything works in the drawing tool demo (tested in Firefox).

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

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=984043&r1=984042&r2=984043&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:21:25 2010
@@ -145,7 +145,7 @@ In both:
 
 
 		function  computeRDelta(oldEvent,newEvent,cachedCenterPoint){
-			return _computeRotationAngle(cachedCenterPoint,{x:oldEvent.localX,y:oldEvent.localY},{x:newEvent.localX,y:newEvent.localY});
+			return _computeRotationAngle(cachedCenterPoint,{x:oldEvent.clientX,y:oldEvent.clientY},{x:newEvent.clientX,y:newEvent.clientY});
 		}
 
 		function  _computeRotationAngle(cpt,pt1,pt2){
@@ -532,10 +532,10 @@ In both:
 						for(var i=0,l=selectedNodes.length; i < l; i++){
 							var n = selectedNodes[i];
 
-							transformModule.rotate(n,rDelta,cachedCenterPoint.x,cachedCenterPoint.y);
+							transformModule.rotateRadians(n,rDelta,cachedCenterPoint.x,cachedCenterPoint.y);
 						}
 
-						transformModule.rotate(rotationHandle,rDelta,cachedCenterPoint.x,cachedCenterPoint.y);
+						transformModule.rotateRadians(rotationHandle,rDelta,cachedCenterPoint.x,cachedCenterPoint.y);
 					]]></script>
 				</transition>
 			</state>

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/build.sh
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/build.sh?rev=984043&r1=984042&r2=984043&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/build.sh (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/build.sh Tue Aug 10 14:21:25
2010
@@ -1,2 +1,5 @@
 #!/bin/bash
+pushd ../../
+./build.sh preprocessStylesheets
+popd
 ../../run.sh --beautify --backend state --log behaviour/canvas.xml > build/canvas.js

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/transform.js
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/transform.js?rev=984043&r1=984042&r2=984043&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/transform.js (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/transform.js Tue Aug 10 14:21:25
2010
@@ -112,16 +112,17 @@ function(){
 		},
 
 		rotateRadians : function (rawNode,radians,cx,cy){
-			this.rotate(rawNode,raidansToDegrees(radians),cx,cy);
+			this.rotate(rawNode,radiansToDegrees(radians),cx,cy);
 		},
 
 		scale : function (rawNode,e1,e2,bbox){
+			bbox = bbox || getBoundingBoxInCanvasCoordinates(rawNode);
+
 			var tl = rawNode.transform.baseVal;
 			var t = tl.numberOfItems ? tl.getItem(0) : rawNode.ownerSVGElement.createSVGTransform();
 			var m = t.matrix;
 
 			var pt1 = {x:e1.clientX,y:e1.clientY},pt2 = {x:e2.clientX,y:e2.clientY}
-			var bbox = bbox || getBoundingBoxInCanvasCoordinates(rawNode);
 			var scaleTransform = _computeScaleTransform(pt1,pt2,bbox,rawNode.ownerSVGElement);
 
 			var newM = scaleTransform.multiply(m);



Mime
View raw message