You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2020/07/05 07:16:19 UTC

[royale-asjs] branch develop updated: need unique clippaths. Should fix #856

This is an automated email from the ASF dual-hosted git repository.

aharui 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 5ff7aab  need unique clippaths.  Should fix #856
5ff7aab is described below

commit 5ff7aabf144f2defef6a3692a4b39366b71b0ec0
Author: Alex Harui <ah...@apache.org>
AuthorDate: Sun Jul 5 00:15:57 2020 -0700

    need unique clippaths.  Should fix #856
---
 .../spark/components/supportClasses/DropDownListButton.as   | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/DropDownListButton.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/DropDownListButton.as
index fd1514b..e3bdd9f 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/DropDownListButton.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/DropDownListButton.as
@@ -26,6 +26,8 @@ package spark.components.supportClasses
 	public class DropDownListButton extends Button
 	{
 		
+		private static var instanceCounter:int = 0;
+		
 		/**
 		 *  Constructor.
          * 
@@ -36,9 +38,13 @@ package spark.components.supportClasses
 		 */
 		public function DropDownListButton()
 		{
-			super();			
+			super();
+			instanceId = instanceCounter.toString();
+			instanceCounter++;
 		}
 		
+		private var instanceId:String;
+		
         override public function setActualSize(w:Number, h:Number):void
         {
             super.setActualSize(w, h);
@@ -58,10 +64,11 @@ package spark.components.supportClasses
         COMPILE::JS
         private function updateSkin(w:Number, h:Number):void
         {
+			var clipid:String = "txtClip" + instanceId;
 			if (h < 4) return;
             element.innerHTML = '<svg width="' + w + 'px" height="' +
-                h + 'px" xmlns="http://www.w3.org/2000/svg"><clipPath id="txtclip"><rect x="0" y="0" height="' + h + 
-				'px" width="' + (w - 29) + 'px"/></clipPath><text y="3px" clip-path="url(#txtclip)">' +
+                h + 'px" xmlns="http://www.w3.org/2000/svg"><clipPath id="' + clipid + '"><rect x="0" y="0" height="' + h + 
+				'px" width="' + (w - 29) + 'px"/></clipPath><text y="3px" clip-path="url(#' + clipid + ')">' +
                 label + '</text><style><![CDATA[' +
                 'text{ dominant-baseline: hanging;' +
                 /*    font: 12px Verdana, Helvetica, Arial, sans-serif;*/