Closed Cicorione closed 3 weeks ago
The problem here is that you don't put the mm
and cm
in quotation marks. They get interpreted as a node selector, selecting nothing and thus evaluate to the empty string. Which results to something like concat($sqr1,cm)
-> concat($sqr1,'')
which is the same as $sqr1
and gets interpreted as "number of grid cells" which have by coincidence the width of 1cm. So 4cm is the same as 4 if the grid size is 1cm.
<Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en"
xmlns:xi="http://www.w3.org/2001/XInclude">
<Trace grid="yes" objects="yes" />
<Pageformat width="100mm" height="100mm" />
<Record element="data">
<SetVariable variable="sqr1" select="4" />
<SetVariable variable="sqr2" select="40" />
<PlaceObject column="1" row="1">
<Box width="4cm" height="4cm" background-color="limegreen" />
</PlaceObject>
<PlaceObject column="5" row="5">
<Box width="40mm" height="40mm" background-color="deeppink" />
</PlaceObject>
<ClearPage />
<PlaceObject column="1" row="1">
<Box width="{concat($sqr1,'cm')}" height="{concat($sqr1,'cm')}" background-color="limegreen" />
</PlaceObject>
<PlaceObject column="5" row="5">
<Box width="{concat($sqr1,'mm')}" height="{concat($sqr1,'mm')}" background-color="deeppink" />
</PlaceObject>
<ClearPage />
<PlaceObject column="1" row="1">
<Box width="{concat($sqr1,'cm')}" height="{concat($sqr1,'cm')}" background-color="limegreen" />
</PlaceObject>
<PlaceObject column="5" row="5">
<Box width="{concat($sqr2,'mm')}" height="{concat($sqr2,'mm')}" background-color="deeppink" />
</PlaceObject>
</Record>
</Layout>
Thank you @pgundlach 🙏
Hi @pgundlach,
I am experience weird behaviors with millimeters (
mm
) as unit size, when you pass the value as variable. In my current code simplymm
aren't displayed, thus I decided to make a test and it looks like the conversion is totally wrong!Check this out:
mm-bug.pdf
Thanks! 🙏