From 25fc738c03caea1a8b5ae72fa7872c4590087ac8 Mon Sep 17 00:00:00 2001 From: GreLI Date: Mon, 15 Feb 2016 14:09:04 +0300 Subject: [PATCH] Fixed transform moving around the mask as well --- plugins/moveElemsAttrsToGroup.js | 2 +- test/plugins/moveElemsAttrsToGroup.04.svg | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/moveElemsAttrsToGroup.js b/plugins/moveElemsAttrsToGroup.js index c97d82a2..f2a00b6b 100644 --- a/plugins/moveElemsAttrsToGroup.js +++ b/plugins/moveElemsAttrsToGroup.js @@ -39,7 +39,7 @@ exports.fn = function(item) { var intersection = {}, hasTransform = false, - hasClip = item.hasAttr('clip-path'), + hasClip = item.hasAttr('clip-path') || item.hasAttr('mask'), intersected = item.content.every(function(inner) { if (inner.isElem() && inner.hasAttr()) { if (!Object.keys(intersection).length) { diff --git a/test/plugins/moveElemsAttrsToGroup.04.svg b/test/plugins/moveElemsAttrsToGroup.04.svg index 91e47083..d7a83238 100644 --- a/test/plugins/moveElemsAttrsToGroup.04.svg +++ b/test/plugins/moveElemsAttrsToGroup.04.svg @@ -1,4 +1,7 @@ + + + @@ -9,11 +12,18 @@ + + + + @@@ + + + @@ -24,4 +34,8 @@ + + + +