This commit is contained in:
Mylloon 2024-05-18 23:02:56 +02:00
parent 1dec319eb4
commit 4e1ab8bbea
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

29
svg.xsl
View file

@ -27,8 +27,10 @@
<xsl:with-param name="minX" select="$minX" />
<xsl:with-param name="minY" select="$minY" />
<xsl:with-param name="strokeWidth">
<!-- On prend le plus grand côté qu'on divise -->
<!-- On prend le plus grand côté qu'on divise
avec `d` une valeur arbitraire qui rend bien -->
<xsl:variable name="d" select="1000" />
<xsl:choose>
<xsl:when test="$width > $height">
<xsl:value-of select="$width div $d" />
@ -44,13 +46,15 @@
<!-- Template pour le traceur -->
<xsl:template match="traceur">
<!-- Dimensions et largeur de trait -->
<xsl:param name="minX" />
<xsl:param name="minY" />
<xsl:param name="strokeWidth" />
<xsl:param
name="minX" />
<xsl:param
name="minY" />
<xsl:param
name="strokeWidth" />
<!-- Décalage -->
<xsl:variable
<xsl:variable
name="transX">
<xsl:choose>
<xsl:when test="0 > $minX">
@ -84,13 +88,14 @@
<xsl:template name="generatePath">
<xsl:param name="idx"
select="1" />
<xsl:param name="x" select="0" />
<xsl:param name="y" select="0" />
<xsl:param name="x"
select="0" />
<xsl:param name="y"
select="0" />
<xsl:if
test="count(*) >= $idx">
<xsl:variable
name="action" select="*[position() = $idx]" />
<xsl:if test="count(*) >= $idx">
<xsl:variable name="action"
select="*[position() = $idx]" />
<xsl:choose>
<!-- Déplacement -->