From 6665565b29c0629d665e99207e850dd84b859856 Mon Sep 17 00:00:00 2001 From: John Kenny Date: Sun, 7 Jan 2024 10:54:20 -0800 Subject: [PATCH 1/3] Add filter to list of attributes preserving transform. --- plugins/moveElemsAttrsToGroup.js | 3 +- test/plugins/moveElemsAttrsToGroup.08.svg.txt | 47 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 test/plugins/moveElemsAttrsToGroup.08.svg.txt diff --git a/plugins/moveElemsAttrsToGroup.js b/plugins/moveElemsAttrsToGroup.js index 96fa6f8a0..5efd79f20 100644 --- a/plugins/moveElemsAttrsToGroup.js +++ b/plugins/moveElemsAttrsToGroup.js @@ -86,8 +86,9 @@ export const fn = (root) => { } } - // preserve transform on children when group has clip-path or mask + // preserve transform on children when group has filter or clip-path or mask if ( + node.attributes['filter'] != null || node.attributes['clip-path'] != null || node.attributes.mask != null ) { diff --git a/test/plugins/moveElemsAttrsToGroup.08.svg.txt b/test/plugins/moveElemsAttrsToGroup.08.svg.txt new file mode 100644 index 000000000..0b685db4c --- /dev/null +++ b/test/plugins/moveElemsAttrsToGroup.08.svg.txt @@ -0,0 +1,47 @@ +Don't move transform if there is a filter attribute on group. + +=== + + + + + + + + + + + + + + + + + + + + + + +@@@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From adf6e27b01e4eef35b08e2503f7dc0792c9e4138 Mon Sep 17 00:00:00 2001 From: John Kenny Date: Mon, 15 Jan 2024 07:48:58 -0800 Subject: [PATCH 2/3] Simplified test case. --- test/plugins/moveElemsAttrsToGroup.08.svg.txt | 34 +++++-------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/test/plugins/moveElemsAttrsToGroup.08.svg.txt b/test/plugins/moveElemsAttrsToGroup.08.svg.txt index 0b685db4c..3f9c8e9b8 100644 --- a/test/plugins/moveElemsAttrsToGroup.08.svg.txt +++ b/test/plugins/moveElemsAttrsToGroup.08.svg.txt @@ -3,45 +3,29 @@ Don't move transform if there is a filter attribute on group. === - - - + + + - - - + - - - - - - @@@ - - - + + + - - - + - - - - - - - \ No newline at end of file + From ea552d53bd07cacf173d35b1fb2e5fe81c09035b Mon Sep 17 00:00:00 2001 From: John Kenny Date: Mon, 15 Jan 2024 08:00:29 -0800 Subject: [PATCH 3/3] Simplified test case. --- test/plugins/moveElemsAttrsToGroup.08.svg.txt | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/test/plugins/moveElemsAttrsToGroup.08.svg.txt b/test/plugins/moveElemsAttrsToGroup.08.svg.txt index 3f9c8e9b8..549629b02 100644 --- a/test/plugins/moveElemsAttrsToGroup.08.svg.txt +++ b/test/plugins/moveElemsAttrsToGroup.08.svg.txt @@ -2,30 +2,28 @@ Don't move transform if there is a filter attribute on group. === - - - - - + - - - + + + + + + @@@ - - - - - + - - - + + + + + +