division ....
This commit is contained in:
parent
34bc66cb4d
commit
24d5a33b0e
1 changed files with 7 additions and 5 deletions
12
svg.xsl
12
svg.xsl
|
@ -19,15 +19,17 @@
|
||||||
|
|
||||||
<xsl:variable name="scale">
|
<xsl:variable name="scale">
|
||||||
<!-- Valeurs trouvés au fils de plusieurs tests -->
|
<!-- Valeurs trouvés au fils de plusieurs tests -->
|
||||||
|
<xsl:variable name="dividende"
|
||||||
|
select="1.4" />
|
||||||
<xsl:variable name="x"
|
<xsl:variable name="x"
|
||||||
select="$width div max(LINETO/@x) div 1.4" />
|
select="$width div max(*/@x) div $dividende" />
|
||||||
<xsl:variable name="y"
|
<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 -->
|
<!-- La plus petite valeur entre X et Y -->
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$y > $x">
|
<xsl:when test="$y > $x">
|
||||||
<xsl:value-of select="$x " />
|
<xsl:value-of select="$x" />
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:value-of select="$y" />
|
<xsl:value-of select="$y" />
|
||||||
|
@ -38,9 +40,9 @@
|
||||||
|
|
||||||
<!-- Translation pour être à peu près centré -->
|
<!-- Translation pour être à peu près centré -->
|
||||||
<xsl:variable
|
<xsl:variable
|
||||||
name="transX" select="($width * 1.2) - max(LINETO/@x) * $scale" />
|
name="transX" select="($width * 1.2) - max(*/@x ) * $scale" />
|
||||||
<xsl:variable
|
<xsl:variable
|
||||||
name="transY" select="$height - max(LINETO/@y) * $scale" />
|
name="transY" select="$height - max(*/@y) * $scale" />
|
||||||
|
|
||||||
<g stroke="black"
|
<g stroke="black"
|
||||||
stroke-width="{1 div $scale}"
|
stroke-width="{1 div $scale}"
|
||||||
|
|
Reference in a new issue