From 17d29e9138b712c7c9d0f97246752ddbfbd75efe Mon Sep 17 00:00:00 2001 From: GreLI Date: Tue, 4 Nov 2014 21:01:03 +0300 Subject: [PATCH] Don't move transform attribute to elems if there is linked object to transform. Fixes #162 --- plugins/moveGroupAttrsToElems.js | 1 + test/plugins/moveGroupAttrsToElems.05.svg | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/plugins/moveGroupAttrsToElems.05.svg diff --git a/plugins/moveGroupAttrsToElems.js b/plugins/moveGroupAttrsToElems.js index bcdb4367..627682e7 100644 --- a/plugins/moveGroupAttrsToElems.js +++ b/plugins/moveGroupAttrsToElems.js @@ -35,6 +35,7 @@ exports.fn = function(item) { item.isElem('g') && item.hasAttr('transform') && !item.isEmpty() && + !item.someAttr(function(attr) { return ~attr.value.indexOf('url(') }) && item.content.every(function(inner) { return inner.isElem(pathElems); }) diff --git a/test/plugins/moveGroupAttrsToElems.05.svg b/test/plugins/moveGroupAttrsToElems.05.svg new file mode 100644 index 00000000..0a605aa4 --- /dev/null +++ b/test/plugins/moveGroupAttrsToElems.05.svg @@ -0,0 +1,15 @@ + + + + + + + +@@@ + + + + + + +