diff --git a/plugins/moveElemsAttrsToGroup.js b/plugins/moveElemsAttrsToGroup.js index bfa95610..c97d82a2 100644 --- a/plugins/moveElemsAttrsToGroup.js +++ b/plugins/moveElemsAttrsToGroup.js @@ -39,6 +39,7 @@ exports.fn = function(item) { var intersection = {}, hasTransform = false, + hasClip = item.hasAttr('clip-path'), intersected = item.content.every(function(inner) { if (inner.isElem() && inner.hasAttr()) { if (!Object.keys(intersection).length) { @@ -62,7 +63,7 @@ exports.fn = function(item) { for (var name in intersection) { - if (!allPath || name !== 'transform') { + if (!allPath && !hasClip || name !== 'transform') { g.removeAttr(name); diff --git a/test/plugins/moveElemsAttrsToGroup.04.svg b/test/plugins/moveElemsAttrsToGroup.04.svg index 13b51554..91e47083 100644 --- a/test/plugins/moveElemsAttrsToGroup.04.svg +++ b/test/plugins/moveElemsAttrsToGroup.04.svg @@ -5,6 +5,10 @@ + + + + @@@ @@ -16,4 +20,8 @@ + + + +