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