Repository: flex-asjs Updated Branches: refs/heads/refactor-sprite be2a507cd -> dbf0df3a3
Fixed Circle and Ellipse Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/dbf0df3a Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/dbf0df3a Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/dbf0df3a Branch: refs/heads/refactor-sprite Commit: dbf0df3a367a2ab88ab768d865ab67d63bf7e5f5 Parents: be2a507 Author: Harbs <ha...@in-tools.com> Authored: Thu Jul 28 10:01:18 2016 +0300 Committer: Harbs <ha...@in-tools.com> Committed: Thu Jul 28 10:01:18 2016 +0300 ---------------------------------------------------------------------- .../src/main/flex/org/apache/flex/svg/Circle.as | 2 +- .../main/flex/org/apache/flex/svg/Ellipse.as | 33 +++++++++++++++----- 2 files changed, 27 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/dbf0df3a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/Circle.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/Circle.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/Circle.as index 9fed746..c48ea7d 100644 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/Circle.as +++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/Circle.as @@ -79,7 +79,7 @@ package org.apache.flex.svg sprite.graphics.clear(); applyStroke(); beginFill(new Rectangle(cx,cy,radius*2, radius*2),new Point(cx-radius,cy-radius)); - sprite.graphics.drawCircle(cx,cy,radius); + sprite.graphics.drawCircle(cx+radius,cy+radius,radius); endFill(); } COMPILE::JS http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/dbf0df3a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/Ellipse.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/Ellipse.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/Ellipse.as index 65658f0..dbbfa0f 100644 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/Ellipse.as +++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/Ellipse.as @@ -68,7 +68,7 @@ package org.apache.flex.svg _rx = value; } - private var _ry:Number; + private var _ry:Number; /** * The vertical radius of the ellipse. @@ -88,6 +88,25 @@ package org.apache.flex.svg _ry = value; } + override public function get width():Number + { + return _rx*2; + } + + override public function set width(value:Number):void + { + _rx = value/2; + } + + override public function get height():Number + { + return _ry*2; + } + + override public function set height(value:Number):void + { + _ry = value/2; + } COMPILE::JS private var _ellipse:WrappedHTMLElement; @@ -127,16 +146,16 @@ package org.apache.flex.svg _ellipse.setAttribute('style', style); if (stroke) { - _ellipse.setAttribute('cx', width / 2 + stroke.weight); - _ellipse.setAttribute('cy', height / 2 + stroke.weight); + _ellipse.setAttribute('cx', rx + stroke.weight); + _ellipse.setAttribute('cy', ry + stroke.weight); } else { - _ellipse.setAttribute('cx', width / 2); - _ellipse.setAttribute('cy', height / 2); + _ellipse.setAttribute('cx', rx); + _ellipse.setAttribute('cy', ry); } - _ellipse.setAttribute('rx', width / 2); - _ellipse.setAttribute('ry', height / 2); + _ellipse.setAttribute('rx', rx); + _ellipse.setAttribute('ry', ry); resize(x, y, (_ellipse as SVGEllipseElement).getBBox());