Lunacy version: 10.0.1
OS version: Windows 10
I’ve been having problems with exporting individual icons/graphics to SVG when they are placed inside a frame.
In Lunacy 9.6.1, so long as ‘Clip Content’ was turned off on the icon’s design properties, this resulted in the exported SVG containing a “harmless” invisible path that was outside the viewbox so although unnecessary and inappropriate did not harm the rendering of the SVG:
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
<g id="icon">
<path d="M16 -308L16 -308L16 -292L0 -292L0 -308L16 -308Z" id="icon" fill="none" stroke="none" />
...
In Lunacy 10.0.1 the behaviour has changed and instead the entire icon graphic is translated outside the viewbox:
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="none" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
<g id="icon" opacity="1" transform="translate(308 292)">
<path d="M16 0L16 0L16 16L0 16L0 0L16 0Z" style="mix-blend-mode:normal;" />
...
Viewing the resulting SVG just shows a blank empty picture, since the graphic is outside the viewbox. The same thing happens when exporting a single group or shape, not just with icons.
The only way I have found to prevent Lunacy from doing this is to move the icon outside of the parent frame, placing it directly onto the workspace background. Exporting it from there results in the transform=“translate(…)” element disappearing from the SVG, and it then renders OK. This is not an ideal workaround because it means there is no easy way to group sets of icons under separate frames when working on a multi-icon project, and the icon names are displayed messily above each icon, which they are not when placed in a frame.
I believe this is a bug - when selecting to export icons, shapes and groups nested within a frame their relative position on that frame should be disregarded.
Here’s an image illustrating the problem, I can send the Lunacy .free file if you want it: