MOVETO support
This commit is contained in:
parent
d5aa66fc35
commit
f7c4fb518f
1 changed files with 19 additions and 9 deletions
22
svg.xsl
22
svg.xsl
|
@ -65,19 +65,29 @@
|
|||
<xsl:param name="path" />
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$idx > count(LINETO)">
|
||||
<xsl:when test="$idx > count(*)">
|
||||
<xsl:value-of select="$path" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="x"
|
||||
select="LINETO[$idx]/@x" />
|
||||
<xsl:variable name="y"
|
||||
select="LINETO[$idx]/@y" />
|
||||
<xsl:variable
|
||||
name="currentNode" select="*[position() = $idx]" />
|
||||
<xsl:variable
|
||||
name="pos" select="concat($currentNode/@x, ' ', $currentNode/@y)" />
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="name($currentNode) = 'MOVETO'">
|
||||
<xsl:call-template name="generatePath">
|
||||
<xsl:with-param name="idx" select="$idx + 1" />
|
||||
<xsl:with-param name="path" select="concat($path, ' L ', $x, ' ', $y)" />
|
||||
<xsl:with-param name="path" select="concat($path, ' M ', $pos)" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="generatePath">
|
||||
<xsl:with-param name="idx" select="$idx + 1" />
|
||||
<xsl:with-param name="path" select="concat($path, ' L ', $pos)" />
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
|
Reference in a new issue