You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pe...@apache.org on 2016/05/13 16:56:24 UTC

git commit: [flex-asjs] [refs/heads/develop] - Fix for bug FLEX-35089. Removed code that reset the position of the SVG elements in JS.

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 90ba45f51 -> ffcf66abc


Fix for bug FLEX-35089. Removed code that reset the position of the SVG elements in JS.


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

Branch: refs/heads/develop
Commit: ffcf66abc935b133e938a8b65e108d706c98bad7
Parents: 90ba45f
Author: Peter Ent <pe...@apache.org>
Authored: Fri May 13 12:56:18 2016 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Fri May 13 12:56:18 2016 -0400

----------------------------------------------------------------------
 .../flex/org/apache/flex/core/graphics/Circle.as     | 14 ++++++--------
 .../flex/org/apache/flex/core/graphics/Ellipse.as    | 12 +++++-------
 .../main/flex/org/apache/flex/core/graphics/Path.as  | 14 +++-----------
 .../main/flex/org/apache/flex/core/graphics/Rect.as  | 12 +++++-------
 .../main/flex/org/apache/flex/core/graphics/Text.as  | 15 +++++++--------
 5 files changed, 26 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ffcf66ab/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Circle.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Circle.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Circle.as
index 8868bec..a806b56 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Circle.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Circle.as
@@ -40,8 +40,8 @@ package org.apache.flex.core.graphics
 
 		/**
 		 *  Draw the circle.
-		 *  @param x The x location of the center of the circle
-		 *  @param y The y location of the center of the circle.
+		 *  @param cx The x location of the center of the circle
+		 *  @param cy The y location of the center of the circle.
 		 *  @param radius The radius of the circle.
 		 *
 		 *  @langversion 3.0
@@ -51,14 +51,14 @@ package org.apache.flex.core.graphics
          *  @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
          *  @flexjsignorecoercion SVGCircleElement
 		 */
-		public function drawCircle(x:Number, y:Number, radius:Number):void
+		public function drawCircle(cx:Number, cy:Number, radius:Number):void
 		{
             COMPILE::AS3
             {
                 graphics.clear();
                 applyStroke();
-                beginFill(new Rectangle(x,y,radius*2, radius*2),new Point(x-radius,y-radius));
-                graphics.drawCircle(x,y,radius);
+                beginFill(new Rectangle(cx,cy,radius*2, radius*2),new Point(cx-radius,cy-radius));
+                graphics.drawCircle(cx,cy,radius);
                 endFill();
             }
             COMPILE::JS                
@@ -71,20 +71,18 @@ package org.apache.flex.core.graphics
                 {
                     circle.setAttribute('cx', String(radius + stroke.weight));
                     circle.setAttribute('cy', String(radius + stroke.weight));
-                    setPosition(x - radius, y - radius, stroke.weight, stroke.weight);
                 }
                 else
                 {
                     circle.setAttribute('cx', String(radius));
                     circle.setAttribute('cy', String(radius));
-                    setPosition(x - radius, y - radius, 0, 0);
                 }
                 
                 circle.setAttribute('rx', String(radius));
                 circle.setAttribute('ry', String(radius));
                 element.appendChild(circle);
                 
-                resize(x, y, (circle as SVGCircleElement).getBBox());
+                resize(x-radius, y-radius, (circle as SVGCircleElement).getBBox());
 
             }
 		}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ffcf66ab/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Ellipse.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Ellipse.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Ellipse.as
index f22161f..3b796bb 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Ellipse.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Ellipse.as
@@ -33,8 +33,8 @@ package org.apache.flex.core.graphics
 		
 		/**
 		 *  Draw the ellipse.
-		 *  @param x The x position of the top-left corner of the bounding box of the ellipse.
-		 *  @param y The y position of the top-left corner of the bounding box of the ellipse.
+		 *  @param xp The x position of the top-left corner of the bounding box of the ellipse.
+		 *  @param yp The y position of the top-left corner of the bounding box of the ellipse.
 		 *  @param width The width of the ellipse.
 		 *  @param height The height of the ellipse.
 		 *
@@ -45,14 +45,14 @@ package org.apache.flex.core.graphics
          *  @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
          *  @flexjsignorecoercion SVGEllipseElement
 		 */
-		public function drawEllipse(x:Number, y:Number, width:Number, height:Number):void
+		public function drawEllipse(xp:Number, yp:Number, width:Number, height:Number):void
 		{
             COMPILE::AS3
             {
                 graphics.clear();
                 applyStroke();
-                beginFill(new Rectangle(x, y, width, height), new Point(x,y));
-                graphics.drawEllipse(x,y,width,height);
+                beginFill(new Rectangle(xp, yp, width, height), new Point(xp,yp));
+                graphics.drawEllipse(xp,yp,width,height);
                 endFill();                    
             }
             COMPILE::JS
@@ -65,13 +65,11 @@ package org.apache.flex.core.graphics
                 {
                     ellipse.setAttribute('cx', String(width / 2 + stroke.weight));
                     ellipse.setAttribute('cy', String(height / 2 + stroke.weight));
-                    setPosition(x, y, stroke.weight * 2, stroke.weight * 2);
                 }
                 else
                 {
                     ellipse.setAttribute('cx', String(width / 2));
                     ellipse.setAttribute('cy', String(height / 2));
-                    setPosition(x, y, 0, 0);
                 }
                 ellipse.setAttribute('rx', String(width / 2));
                 ellipse.setAttribute('ry', String(height / 2));

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ffcf66ab/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Path.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Path.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Path.as
index 2d69364..7cef8bb 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Path.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Path.as
@@ -58,7 +58,7 @@ package org.apache.flex.core.graphics
 		 *  @productversion FlexJS 0.0
 		 *  @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
 		 */
-		public function drawPath(x:Number,y:Number,data:String):void
+		public function drawPath(xp:Number,yp:Number,data:String):void
 		{
 			COMPILE::AS3
             {
@@ -67,8 +67,8 @@ package org.apache.flex.core.graphics
                 var bounds:Rectangle = PathHelper.getBounds(data);
                 this.width = bounds.width;
                 this.height = bounds.height;
-                beginFill(bounds,new Point(bounds.left + x, bounds.top + y) );
-                var graphicsPath:GraphicsPath = PathHelper.getSegments(data,x,y);
+                beginFill(bounds,new Point(bounds.left + xp, bounds.top + yp) );
+                var graphicsPath:GraphicsPath = PathHelper.getSegments(data,xp,yp);
                 graphics.drawPath(graphicsPath.commands, graphicsPath.data);
                 endFill();
             }
@@ -81,14 +81,6 @@ package org.apache.flex.core.graphics
                 path.setAttribute('style', style);
                 path.setAttribute('d', data);
                 element.appendChild(path);
-                if (stroke)
-                {
-                    setPosition(x, y, stroke.weight, stroke.weight);
-                }
-                else
-                {
-                    setPosition(x, y, 0, 0);
-                }
 
                 resize(x, y, path['getBBox']());
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ffcf66ab/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Rect.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Rect.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Rect.as
index fd1daa8..5f402ec 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Rect.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Rect.as
@@ -31,8 +31,8 @@ package org.apache.flex.core.graphics
 		
 		/**
 		 *  Draw the rectangle.
-		 *  @param x The x position of the top-left corner of the rectangle.
-		 *  @param y The y position of the top-left corner.
+		 *  @param xp The x position of the top-left corner of the rectangle.
+		 *  @param yp The y position of the top-left corner.
 		 *  @param width The width of the rectangle.
 		 *  @param height The height of the rectangle.
 		 *
@@ -42,14 +42,14 @@ package org.apache.flex.core.graphics
 		 *  @productversion FlexJS 0.0
          *  @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
 		 */
-		public function drawRect(x:Number, y:Number, width:Number, height:Number):void
+		public function drawRect(xp:Number, yp:Number, width:Number, height:Number):void
 		{
             COMPILE::AS3
             {
                 graphics.clear();
                 applyStroke();
-                beginFill(new Rectangle(x, y, width, height), new Point(x,y));
-                graphics.drawRect(x, y, width, height);
+                beginFill(new Rectangle(xp, yp, width, height), new Point(xp,yp));
+                graphics.drawRect(xp, yp, width, height);
                 endFill();                    
             }
             COMPILE::JS
@@ -62,13 +62,11 @@ package org.apache.flex.core.graphics
                 {
                     rect.setAttribute('x', String(stroke.weight / 2) + 'px');
                     rect.setAttribute('y', String(stroke.weight / 2) + 'px');
-                    setPosition(x, y, stroke.weight, stroke.weight);
                 }
                 else
                 {
                     rect.setAttribute('x', '0' + 'px');
                     rect.setAttribute('y', '0' + 'px');
-                    setPosition(x, y, 0, 0);
                 }
                 rect.setAttribute('width', String(width) + 'px');
                 rect.setAttribute('height', String(height) + 'px');

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ffcf66ab/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Text.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Text.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Text.as
index 24dd840..bc429ed 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Text.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Text.as
@@ -81,8 +81,8 @@ package org.apache.flex.core.graphics
 		/**
 		 *  Draws text at the given point.
 		 *  @param value The string to draw.
-		 *  @param x The x position of the top-left corner of the rectangle.
-		 *  @param y The y position of the top-left corner.
+		 *  @param xt The x position of the top-left corner of the rectangle.
+		 *  @param yt The y position of the top-left corner.
 		 *
 		 *  @langversion 3.0
 		 *  @playerversion Flash 10.2
@@ -93,7 +93,7 @@ package org.apache.flex.core.graphics
          *  @flexjsignorecoercion Node
          *  @flexjsignorecoercion SVGLocatable
 		 */
-		public function drawText(value:String, x:Number, y:Number):void
+		public function drawText(value:String, xt:Number, yt:Number):void
 		{
             COMPILE::AS3
             {
@@ -109,8 +109,8 @@ package org.apache.flex.core.graphics
                     textField.alpha = color.alpha;
                 }
                 
-                textField.x = x;
-                textField.y = y;                    
+                textField.x = xt;
+                textField.y = yt;                    
             }
             COMPILE::JS
             {
@@ -118,9 +118,8 @@ package org.apache.flex.core.graphics
                 var text:WrappedHTMLElement = document.createElementNS('http://www.w3.org/2000/svg', 'text') as WrappedHTMLElement;
                 text.flexjs_wrapper = this;
                 text.setAttribute('style', style);
-                text.setAttribute('x', String(x) + 'px');
-                text.setAttribute('y', String(y) + 'px');
-                setPosition(x, y, 0, 0);
+                text.setAttribute('x', String(xt) + 'px');
+                text.setAttribute('y', String(yt) + 'px');
                 var textNode:Text = document.createTextNode(value) as Text;
                 text.appendChild(textNode as Node);
                 element.appendChild(text);