Skip to content

Commit

Permalink
SVG Export: Do not filter out empty paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
lehni committed Feb 15, 2016
1 parent 7f48486 commit 6975690
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/svg/SvgExport.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,26 +108,25 @@ new function() {
return exportShape(shape, options);
}
var segments = item._segments,
length = segments.length,
type,
attrs = getTransform(item._matrix);
if (segments.length === 0 && !item.isClipMask())
return null;
if (matchShapes && !item.hasHandles()) {
if (segments.length >= 3) {
if (matchShapes && length >= 2 && !item.hasHandles()) {
if (length > 2) {
type = item._closed ? 'polygon' : 'polyline';
var parts = [];
for(var i = 0, l = segments.length; i < l; i++)
for(var i = 0; i < length; i++)
parts.push(formatter.point(segments[i]._point));
attrs.points = parts.join(' ');
} else {
type = 'line';
var first = segments[0]._point,
last = segments[segments.length - 1]._point;
var start = segments[0]._point,
end = segments[1]._point;
attrs.set({
x1: first.x,
y1: first.y,
x2: last.x,
y2: last.y
x1: start.x,
y1: start.y,
x2: end.x,
y2: end.y
});
}
} else {
Expand Down

0 comments on commit 6975690

Please sign in to comment.