Fix SVG export with Symbol (#1670)

Closes #1668
This commit is contained in:
Samuel Asensi 2019-06-18 06:15:20 +02:00 committed by Jürg Lehni
parent 91a7448c07
commit c04746aa00
2 changed files with 16 additions and 1 deletions

View file

@ -182,7 +182,7 @@ new function() {
definition = item._definition,
node = getDefinition(definition, 'symbol'),
definitionItem = definition._item,
bounds = definitionItem.getBounds();
bounds = definitionItem.getStrokeBounds();
if (!node) {
node = SvgElement.create('symbol', {
viewBox: formatter.rectangle(bounds)

View file

@ -229,4 +229,19 @@ if (!isNodeContext) {
tolerance: 1e-2
});
});
test('Export symbol with stroke', function(assert) {
var item = new Path.Circle({
center: [0, 0],
radius: 50,
strokeColor: 'blue',
strokeWidth: 10
});
var symbol = new Symbol(item);
symbol.place([50, 50]);
var svg = project.exportSVG({ bounds: 'content', asString: true });
compareSVG(assert.async(), svg, project.activeLayer);
});
}