flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bigosma...@apache.org
Subject [1/2] git commit: XSLT now handles left, right, top and bottom
Date Wed, 27 Mar 2013 22:50:28 GMT
Updated Branches:
  refs/heads/develop ae3a4756d -> 24de65c06


XSLT now handles left, right, top and bottom


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

Branch: refs/heads/develop
Commit: cbf8fc1d7fce66c62d56a9f394ddc7914b6c04ab
Parents: ac091ac
Author: Om <bigosmallm@gmail.com>
Authored: Wed Mar 27 15:49:09 2013 -0700
Committer: Om <bigosmallm@gmail.com>
Committed: Wed Mar 27 15:49:09 2013 -0700

----------------------------------------------------------------------
 fxg2svg/rect.xml       |   20 +++++++++++++++++++
 fxg2svg/transform.xslt |   44 +++++++++++++++++++++++++++++++++---------
 2 files changed, 54 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cbf8fc1d/fxg2svg/rect.xml
----------------------------------------------------------------------
diff --git a/fxg2svg/rect.xml b/fxg2svg/rect.xml
index 5ab8282..d5b0301 100644
--- a/fxg2svg/rect.xml
+++ b/fxg2svg/rect.xml
@@ -42,4 +42,24 @@
 			</s:LinearGradient>
 		</s:fill>
 	</s:Rect>
+    <s:Rect id="highlight" left="1" right="1" top="1" bottom="1" radiusX="2">
+        <s:fill>
+            <s:LinearGradient rotation="90">
+                <s:GradientEntry color="0xFFFFFF"
+                                 ratio="0.0"
+                                 alpha="0.33" 
+                                 alpha.over="0.22" 
+                                 alpha.down="0.12"/>
+                <s:GradientEntry color="0xFFFFFF"
+                                 ratio="0.48"
+                                 alpha="0.33"
+                                 alpha.over="0.22"
+                                 alpha.down="0.12" />
+                <s:GradientEntry color="0xFFFFFF"
+                                 ratio="0.48001"
+                                 alpha="0" />
+            </s:LinearGradient>
+        </s:fill>
+    </s:Rect>	
+	
 </s:Application>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cbf8fc1d/fxg2svg/transform.xslt
----------------------------------------------------------------------
diff --git a/fxg2svg/transform.xslt b/fxg2svg/transform.xslt
index df474c4..b1a7389 100644
--- a/fxg2svg/transform.xslt
+++ b/fxg2svg/transform.xslt
@@ -25,22 +25,40 @@
 	<xsl:output method="xml" encoding="UTF-8" indent="yes" />
 
 	<xsl:template match="/">
-		<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"
-			version="1.1">
-			<defs>
-				<xsl:apply-templates mode="defs" />
-			</defs>
 			<xsl:apply-templates mode="rect" />
-			
-		</svg>
 	</xsl:template>
 	
 	<xsl:template match="fx:Script" mode="#all" />
 	<xsl:template match="fx:Metadata" mode="#all" />
 
-	<xsl:template match="s:Rect" mode="rect">
+	<xsl:template match="s:Rect|Rect" mode="rect">
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"
+			version="1.1" >
+			<xsl:if test="@left">
+				<xsl:attribute name="left">
+					<xsl:value-of select="@left" />
+				</xsl:attribute>
+			</xsl:if>
+			<xsl:if test="@right">
+				<xsl:attribute name="right">
+					<xsl:value-of select="@right" />
+				</xsl:attribute>
+			</xsl:if>
+			<xsl:if test="@top">
+				<xsl:attribute name="top">
+					<xsl:value-of select="@top" />
+				</xsl:attribute>
+			</xsl:if>
+			<xsl:if test="@bottom">
+				<xsl:attribute name="bottom">
+					<xsl:value-of select="@bottom" />
+				</xsl:attribute>
+			</xsl:if>
+			<defs>
+				<xsl:apply-templates mode="defs" />
+			</defs>
 		<rect >
-		<xsl:if test="@id">
+			<xsl:if test="@id">
 				<xsl:attribute name="id">
 					<xsl:value-of select="@id" />
 				</xsl:attribute>
@@ -92,11 +110,17 @@
 					<xsl:value-of select="@radiusY" />
 				</xsl:attribute>
 			</xsl:if>
+			<xsl:if test="not(@width) ">
+					<xsl:attribute name="width">100%</xsl:attribute>
+			</xsl:if>
+			<xsl:if test="not(@height) ">
+					<xsl:attribute name="height">100%</xsl:attribute>
+			</xsl:if>
 
 			<xsl:apply-templates mode="rect" />
 
 		</rect>
-
+</svg>
 	</xsl:template>
 
 	<xsl:template match="s:fill" mode="rect">


Mime
View raw message