This is an automated email from the ASF dual-hosted git repository.
yishayw pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 8417457 Add DisableClipBead, also make sure manifest is svg-manifest
is included in build
8417457 is described below
commit 8417457e97a03555f7ee8bbccb9f280b7d1cd44c
Author: DESKTOP-RH4S838\Yishay <[email protected]>
AuthorDate: Sun Dec 10 14:31:49 2017 +0200
Add DisableClipBead, also make sure manifest is svg-manifest is included in
build
---
.../src/main/config/compile-js-config.xml | 5 +
.../src/main/config/compile-swf-config.xml | 1 +
.../Graphics/src/main/resources/svg-manifest.xml | 1 +
.../Graphics/src/main/royale/GraphicsClasses.as | 1 -
.../org/apache/royale/svg/DisableClipBead.as | 126 +++++++++++++++++++++
5 files changed, 133 insertions(+), 1 deletion(-)
diff --git
a/frameworks/js/projects/GraphicsJS/src/main/config/compile-js-config.xml
b/frameworks/js/projects/GraphicsJS/src/main/config/compile-js-config.xml
index 52298e6..5fc1c74 100644
--- a/frameworks/js/projects/GraphicsJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/projects/GraphicsJS/src/main/config/compile-js-config.xml
@@ -65,6 +65,10 @@
<namespaces>
<namespace>
+ <uri>library://ns.apache.org/royale/svg</uri>
+
<manifest>../../../../../../projects/Graphics/src/main/resources/svg-manifest.xml</manifest>
+ </namespace>
+ <namespace>
<uri>library://ns.apache.org/royale/basic</uri>
<manifest>../../../../../../projects/Graphics/src/main/resources/basic-manifest.xml</manifest>
</namespace>
@@ -91,6 +95,7 @@
<include-namespaces>
<uri>library://ns.apache.org/royale/basic</uri>
+ <uri>library://ns.apache.org/royale/svg</uri>
</include-namespaces>
diff --git
a/frameworks/projects/Graphics/src/main/config/compile-swf-config.xml
b/frameworks/projects/Graphics/src/main/config/compile-swf-config.xml
index c862abf..0b01274 100644
--- a/frameworks/projects/Graphics/src/main/config/compile-swf-config.xml
+++ b/frameworks/projects/Graphics/src/main/config/compile-swf-config.xml
@@ -91,6 +91,7 @@
<include-namespaces>
<uri>library://ns.apache.org/royale/basic</uri>
+ <uri>library://ns.apache.org/royale/svg</uri>
</include-namespaces>
<target-player>${playerglobal.version}</target-player>
diff --git a/frameworks/projects/Graphics/src/main/resources/svg-manifest.xml
b/frameworks/projects/Graphics/src/main/resources/svg-manifest.xml
index 8154dfe..e3b735a 100644
--- a/frameworks/projects/Graphics/src/main/resources/svg-manifest.xml
+++ b/frameworks/projects/Graphics/src/main/resources/svg-manifest.xml
@@ -22,6 +22,7 @@
<componentPackage>
<component id="TransformBead"
class="org.apache.royale.svg.TransformBead" />
<component id="ClipBead" class="org.apache.royale.svg.ClipBead" />
+ <component id="DisableClipBead"
class="org.apache.royale.svg.DisableClipBead" />
<component id="LinearGradient"
class="org.apache.royale.svg.LinearGradient" />
</componentPackage>
diff --git a/frameworks/projects/Graphics/src/main/royale/GraphicsClasses.as
b/frameworks/projects/Graphics/src/main/royale/GraphicsClasses.as
index 9212110..b2c23e3 100644
--- a/frameworks/projects/Graphics/src/main/royale/GraphicsClasses.as
+++ b/frameworks/projects/Graphics/src/main/royale/GraphicsClasses.as
@@ -31,7 +31,6 @@ internal class GraphicsClasses
import org.apache.royale.graphics.SolidColor; SolidColor;
import org.apache.royale.graphics.SolidColorStroke; SolidColorStroke;
import org.apache.royale.svg.TransformBead; TransformBead;
- import org.apache.royale.svg.ClipBead; ClipBead;
import org.apache.royale.svg.LinearGradient; LinearGradient;
import org.apache.royale.graphics.CubicCurve; CubicCurve;
import org.apache.royale.graphics.LineStyle; LineStyle;
diff --git
a/frameworks/projects/Graphics/src/main/royale/org/apache/royale/svg/DisableClipBead.as
b/frameworks/projects/Graphics/src/main/royale/org/apache/royale/svg/DisableClipBead.as
new file mode 100644
index 0000000..c1dfe98
--- /dev/null
+++
b/frameworks/projects/Graphics/src/main/royale/org/apache/royale/svg/DisableClipBead.as
@@ -0,0 +1,126 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.svg
+{
+
+ import org.apache.royale.core.IBead;
+ import org.apache.royale.core.IRenderedObject;
+ import org.apache.royale.core.IStrand;
+
+ COMPILE::SWF {
+ import flash.display.Graphics;
+ import flash.display.Sprite;
+ import flash.display.DisplayObject;
+ }
+
+ /**
+ * The DisableClipBead bead allows you to disable
+ * a ClipBead.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9
+ */
+ public class DisableClipBead implements IBead
+ {
+ private var _strand:IStrand;
+ private var _disabled:Boolean;
+ COMPILE::JS
+ {
+ private var cachedClipPath:String;
+ }
+ COMPILE::SWF
+ {
+ private var cachedMask:Sprite;
+ }
+
+ public function DisableClipBead()
+ {
+ }
+
+ public function get disabled():Boolean
+ {
+ return _disabled;
+ }
+
+ public function set disabled(value:Boolean):void
+ {
+ _disabled = value;
+ if (host)
+ {
+ disable();
+ }
+ }
+
+ /**
+ * @copy org.apache.royale.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ disable();
+ }
+
+ COMPILE::SWF
+ private function disable():void
+ {
+ var element:DisplayObject = host.$displayObject as
DisplayObject;
+ if (disabled)
+ {
+ cachedMask = element.mask as Sprite;
+ element.mask = null;
+ } else
+ {
+ element.mask = cachedMask;
+ cachedMask = null;
+ }
+ }
+
+ COMPILE::JS
+ private function disable():void
+ {
+ if (host.element.style["clipPath"] === undefined)
+ {
+ return;
+ }
+ if (disabled)
+ {
+ cachedClipPath = host.element.style["clipPath"]
as String;
+ host.element.style["clipPath"] = "";
+ } else
+ {
+ host.element.style["clipPath"] = cachedClipPath;
+ cachedClipPath = null;
+ }
+ }
+
+ public function get host():IRenderedObject
+ {
+ return _strand as IRenderedObject;
+ }
+
+ }
+}
+
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].