mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Avoid empty d attributes in SVG nodes, since they throw errors.
This commit is contained in:
parent
936b1bccbb
commit
a63e8ac54c
1 changed files with 5 additions and 4 deletions
|
@ -216,9 +216,8 @@ new function() {
|
|||
case 'empty':
|
||||
return null;
|
||||
case 'path':
|
||||
attrs = {
|
||||
d: item.getPathData()
|
||||
};
|
||||
var data = item.getPathData();
|
||||
attrs = data && { d: data };
|
||||
break;
|
||||
case 'polyline':
|
||||
case 'polygon':
|
||||
|
@ -307,7 +306,9 @@ new function() {
|
|||
|
||||
function exportCompoundPath(item) {
|
||||
var attrs = getTransform(item, true);
|
||||
attrs.d = item.getPathData();
|
||||
var data = item.getPathData();
|
||||
if (data)
|
||||
attrs.d = data;
|
||||
return createElement('path', attrs);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue