File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -304,6 +304,12 @@ new function() {
304304 var get = entry . get ,
305305 type = entry . type ,
306306 value = item [ get ] ( ) ;
307+
308+ // In some cases, the style's value is undefined. Trying to save it
309+ // will result in erroneous behavior; for instance, properties like
310+ // "fill-rule" will have the invalid value of "none" if undefined.
311+ if ( value === undefined ) return ;
312+
307313 if ( entry . exportFilter
308314 ? entry . exportFilter ( item , value )
309315 : ! parent || ! Base . equals ( parent [ get ] ( ) , value ) ||
Original file line number Diff line number Diff line change @@ -531,7 +531,14 @@ new function() {
531531 if ( matrix )
532532 group . transform ( matrix ) ;
533533 }
534- }
534+ } ,
535+
536+ 'fill-rule' : function ( item , value ) {
537+ // Sometimes, the fill-rule attribute will be set to "none" due to a paper.js bug.
538+ // This is coerced into a `null`. A null `fillRule` will cause certain operaions to error out.
539+ // So, only set the fill rule if it's one of the two valid options: "evenodd" and "nonzero".
540+ if ( value === 'evenodd' || value === 'nonzero' ) item . fillRule = value ;
541+ }
535542 } ) ;
536543
537544 function getAttribute ( node , name , styles ) {
You can’t perform that action at this time.
0 commit comments