xaml export of some mm values (e.g. for ellipse cx/cy) produces NaN
Steps to reproduce:
- Open inkscape-mm-test.svg
- Open Save As dialog
- Export as xaml
File is typical svg file modified so ry, rx, xy, cx values have mm units (<ellipse ry="3.222mm" rx="2.222mm" cy="5.222mm" cx="4.222mm" id="path1285" style="stroke:red;stroke-width:2mm" />
)
What happened?
Exported file (inkscape-mm-test.xaml) has NaN values (likely in most places the svg2xaml.xsl extension requires calculation of values).
<Ellipse xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Canvas.Left="NaN" Width="NaN" Canvas.Top="NaN" Height="NaN" Name="path1285" Fill="#000000" StrokeThickness="7.559054" Stroke="#ff0000"/>
From inbox#2236 (comment 321526485), snippet of svg2xaml.xsl and explanation:
<xsl:if test="@rx">
<xsl:attribute name="Canvas.Left"><xsl:value-of select='format-number($cx - @rx, "#.#")' /></xsl:attribute>
<xsl:attribute name="Width"><xsl:value-of select='format-number(2 * @rx, "#.#")' /></xsl:attribute>
</xsl:if>
That's because the implicit string-to-number conversion, which is performed during the arithmeric operation, fails.
Inkscape Version and Operating System:
Inkscape 1.1-dev (ce96f98111, 2020-04-08) Linux Mint 19.1