division ....

This commit is contained in:
Mylloon 2024-05-06 21:54:25 +02:00
parent 34bc66cb4d
commit 24d5a33b0e
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

12
svg.xsl
View file

@ -19,15 +19,17 @@
<xsl:variable name="scale">
<!-- Valeurs trouvés au fils de plusieurs tests -->
<xsl:variable name="dividende"
select="1.4" />
<xsl:variable name="x"
select="$width div max(LINETO/@x) div 1.4" />
select="$width div max(*/@x) div $dividende" />
<xsl:variable name="y"
select="$height div max(LINETO/@y) div 1.4" />
select="$height div max(*/@y) div $dividende" />
<!-- La plus petite valeur entre X et Y -->
<xsl:choose>
<xsl:when test="$y > $x">
<xsl:value-of select="$x " />
<xsl:value-of select="$x" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$y" />
@ -38,9 +40,9 @@
<!-- Translation pour être à peu près centré -->
<xsl:variable
name="transX" select="($width * 1.2) - max(LINETO/@x) * $scale" />
name="transX" select="($width * 1.2) - max(*/@x ) * $scale" />
<xsl:variable
name="transY" select="$height - max(LINETO/@y) * $scale" />
name="transY" select="$height - max(*/@y) * $scale" />
<g stroke="black"
stroke-width="{1 div $scale}"