You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by yi...@apache.org on 2018/07/16 11:09:31 UTC
[royale-asjs] branch blend_for_compound_graphic created (now
a89193b)
This is an automated email from the ASF dual-hosted git repository.
yishayw pushed a change to branch blend_for_compound_graphic
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git.
at a89193b Make CompoundGraphic transformable (and blendable on Chrome).
This branch includes the following new commits:
new a89193b Make CompoundGraphic transformable (and blendable on Chrome).
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[royale-asjs] 01/01: Make CompoundGraphic transformable (and
blendable on Chrome).
Posted by yi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
yishayw pushed a commit to branch blend_for_compound_graphic
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit a89193bb41931f995b771effe52c26958e183250
Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
AuthorDate: Mon Jul 16 14:08:01 2018 +0300
Make CompoundGraphic transformable (and blendable on Chrome).
---
.../org/apache/royale/svg/CompoundGraphic.as | 35 ++++++++++++++++++----
1 file changed, 29 insertions(+), 6 deletions(-)
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/svg/CompoundGraphic.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/svg/CompoundGraphic.as
index b980695..ab4620b 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/svg/CompoundGraphic.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/svg/CompoundGraphic.as
@@ -51,6 +51,8 @@ package org.apache.royale.svg
*/
public class CompoundGraphic extends GraphicShape implements ICompoundGraphic
{
+ COMPILE::JS
+ protected var groupElement:WrappedHTMLElement;
private var _textFill:IFill;
public function get textFill():IFill
@@ -89,6 +91,20 @@ package org.apache.royale.svg
_textStroke = value;
}
+ COMPILE::JS
+ private var _groupElement:WrappedHTMLElement;
+ /**
+ * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ super.createElement();
+ _groupElement = document.createElementNS('http://www.w3.org/2000/svg', 'g') as org.apache.royale.core.WrappedHTMLElement;
+ element.appendChild(_groupElement);
+ return element;
+ }
+
/**
* Removes all of the drawn elements of the container.
*
@@ -118,7 +134,7 @@ package org.apache.royale.svg
}
COMPILE::JS
{
- var svg:HTMLElement = element;
+ var svg:HTMLElement = _groupElement;
while (svg.lastChild) {
svg.removeChild(svg.lastChild);
}
@@ -200,7 +216,7 @@ package org.apache.royale.svg
rect.setAttribute('rx', radiusX);
rect.setAttribute('ry', radiusY);
}
- element.appendChild(rect);
+ _groupElement.appendChild(rect);
}
}
@@ -239,10 +255,17 @@ package org.apache.royale.svg
ellipse.setAttribute('cy', y + height / 2);
ellipse.setAttribute('rx', width / 2);
ellipse.setAttribute('ry', height / 2);
- element.appendChild(ellipse);
+ _groupElement.appendChild(ellipse);
}
}
+ COMPILE::JS
+ override public function get transformElement():org.apache.royale.core.WrappedHTMLElement
+ {
+ return _groupElement;
+ }
+
+
/**
* Draw the circle.
* @param x The x location of the center of the circle
@@ -276,7 +299,7 @@ package org.apache.royale.svg
circle.setAttribute('cy', y);
circle.setAttribute('rx', radius);
circle.setAttribute('ry', radius);
- element.appendChild(circle);
+ _groupElement.appendChild(circle);
}
}
@@ -332,7 +355,7 @@ package org.apache.royale.svg
path.style.top = "0px";
path.setAttribute('style', style);
path.setAttribute('d', data);
- element.appendChild(path);
+ _groupElement.appendChild(path);
}
}
@@ -550,7 +573,7 @@ package org.apache.royale.svg
text.setAttribute('y', y + 15);
var textNode:Text = document.createTextNode(value) as Text;
text.appendChild(textNode as Node);
- element.appendChild(text);
+ _groupElement.appendChild(text);
return text;
}
}