flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [03/50] git commit: [flex-asjs] [refs/heads/master] - First working version on JS side.
Date Wed, 07 Sep 2016 22:33:38 GMT
First working version on JS side.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/37251739
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/37251739
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/37251739

Branch: refs/heads/master
Commit: 372517392e007d846fecb8785450ac0fc26249cf
Parents: a94a923
Author: yishayw <yishayjobs@hotmail.com>
Authored: Thu Jul 28 11:00:23 2016 +0300
Committer: yishayw <yishayjobs@hotmail.com>
Committed: Thu Jul 28 11:00:23 2016 +0300

----------------------------------------------------------------------
 .../flex/graphics/TransformRotateModel.as       | 28 +++++++++++++++++
 .../org/apache/flex/svg/GraphicContainer.as     | 32 +-------------------
 .../flex/org/apache/flex/svg/TransformBead.as   |  9 ++++--
 3 files changed, 35 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/37251739/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformRotateModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformRotateModel.as
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformRotateModel.as
new file mode 100644
index 0000000..2dd97fc
--- /dev/null
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformRotateModel.as
@@ -0,0 +1,28 @@
+package org.apache.flex.graphics
+{
+	import org.apache.flex.geom.Matrix;
+	
+	
+	public class TransformRotateModel extends TransformModel
+	{
+		private var _angle:Number;
+		
+		public function TransformRotateModel()
+		{
+		}
+		
+		public function get angle():Number
+		{
+			return _angle;
+		}
+
+		public function set angle(value:Number):void
+		{
+			_angle = value;
+			var radians:Number = value * Math.PI/180;
+			matrix = new Matrix(Math.cos(radians), Math.sin(radians), -Math.sin(radians), Math.cos(radians));
+		}
+
+
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/37251739/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
index b40b53b..351bcec 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
@@ -33,28 +33,6 @@ package org.apache.flex.svg
             super();
         }
 
-		/**
-		 *  @private
-		 */
-		override public function addElement(c:Object, dispatchEvent:Boolean = true):void
-		{
-			if(c is GraphicShape)
-				super.addElement(c, dispatchEvent);
-			else 
-				throw new Error("Only svg elements can be added to svg containers");
-		}
-		
-		/**
-		 *  @private
-		 */
-		override public function addElementAt(c:Object, index:int, dispatchEvent:Boolean = true):void
-		{
-			if(c is GraphicShape)
-				super.addElementAt(c, index, dispatchEvent);
-			else 
-				throw new Error("Only svg elements can be added to svg containers");
-		}
-		
 		public function get transformElement():IFlexJSElement
 		{
 			return element;
@@ -89,7 +67,7 @@ package org.apache.flex.svg
 			element.flexjs_wrapper = this;
 			
 			graphicGroup = new GraphicGroup();
-			addElement(graphicGroup);
+			super.addElement(graphicGroup);
 			return element;
 		}
 
@@ -122,10 +100,6 @@ package org.apache.flex.svg
 		 */
 		override public function addElement(c:Object, dispatchEvent:Boolean = true):void
 		{
-			if(!(c is GraphicShape))
-			{
-				throw new Error("Only svg elements can be added to svg containers");
-			}
 			graphicGroup.addElement(c, dispatchEvent);
 			if (dispatchEvent)
 				this.dispatchEvent(new Event("childrenAdded"));
@@ -141,10 +115,6 @@ package org.apache.flex.svg
 		 */
 		override public function addElementAt(c:Object, index:int, dispatchEvent:Boolean = true):void
 		{
-			if(!(c is GraphicShape))
-			{
-				throw new Error("Only svg elements can be added to svg containers");
-			}
 			graphicGroup.addElementAt(c, index, dispatchEvent);
 			if (dispatchEvent)
 				this.dispatchEvent(new Event("childrenAdded"));

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/37251739/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
index ed9de0e..3cba59b 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
@@ -59,14 +59,17 @@ package org.apache.flex.svg
 			var flashMatrix:flash.geom.Matrix = new flash.geom.Matrix(fjsm.a, fjsm.b, fjsm.c, fjsm.d,
fjsm.tx, fjsm.ty);
 			element.transform.matrix = flashMatrix;
 		}
-		
+		/**
+		 * @flexjsignorecoercion HTMLElement
+		 */
 		COMPILE::JS
 		public function transform():void
 		{
 			var element:org.apache.flex.core.WrappedHTMLElement = host.transformElement;
+			(element.parentNode as HTMLElement).setAttribute("overflow", "visible");
 			var fjsm:org.apache.flex.geom.Matrix = transformModel.matrix;
-			var elem:Array = [fjsm.a , fjsm.b, fjsm.c, fjsm.d, fjsm.tx, fjsm.ty];
-			element.setAttribute("transform", "matrix(" +elem.join(",") + ")";
+			var matrixArray:Array = [fjsm.a , fjsm.b, fjsm.c, fjsm.d, fjsm.tx, fjsm.ty];
+			element.setAttribute("transform", "matrix(" +matrixArray.join(",") + ")";
 		}
 		
 		private function changeHandler(e:Event):void


Mime
View raw message