offset
This commit is contained in:
parent
ff5df5b1b2
commit
97e45ac8d1
1 changed files with 9 additions and 3 deletions
12
svg.xsl
12
svg.xsl
|
@ -12,10 +12,14 @@
|
||||||
|
|
||||||
<!-- Template pour le traceur -->
|
<!-- Template pour le traceur -->
|
||||||
<xsl:template match="traceur">
|
<xsl:template match="traceur">
|
||||||
|
<!-- TODO: usage temporaire d'un offset pour que l'image soit pas hors de
|
||||||
|
l'écran, il faut trouver à l'avenir un moyen que ça soit automatique ?? -->
|
||||||
|
<xsl:variable name="offset" select="500" />
|
||||||
<xsl:variable name="path">
|
<xsl:variable name="path">
|
||||||
<xsl:call-template name="generatePath">
|
<xsl:call-template name="generatePath">
|
||||||
<xsl:with-param name="idx" select="1" />
|
<xsl:with-param name="idx" select="1" />
|
||||||
<xsl:with-param name="path" select="'M 0 0'" />
|
<xsl:with-param name="path" select="'M ' || $offset || ' ' || $offset" />
|
||||||
|
<xsl:with-param name="offset" select="500" />
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
|
|
||||||
|
@ -27,6 +31,7 @@
|
||||||
<xsl:template name="generatePath">
|
<xsl:template name="generatePath">
|
||||||
<xsl:param name="idx" />
|
<xsl:param name="idx" />
|
||||||
<xsl:param name="path" />
|
<xsl:param name="path" />
|
||||||
|
<xsl:param name="offset" />
|
||||||
|
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$idx > count(LINETO)">
|
<xsl:when test="$idx > count(LINETO)">
|
||||||
|
@ -34,13 +39,14 @@
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:variable name="x"
|
<xsl:variable name="x"
|
||||||
select="LINETO[$idx]/@x" />
|
select="LINETO[$idx]/@x + number($offset)" />
|
||||||
<xsl:variable name="y"
|
<xsl:variable name="y"
|
||||||
select="LINETO[$idx]/@y" />
|
select="LINETO[$idx]/@y + number($offset)" />
|
||||||
|
|
||||||
<xsl:call-template name="generatePath">
|
<xsl:call-template name="generatePath">
|
||||||
<xsl:with-param name="idx" select="$idx + 1" />
|
<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, ' L ', $x, ' ', $y)" />
|
||||||
|
<xsl:with-param name="offset" select="$offset" />
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
|
|
Reference in a new issue