From b4ff0d347ef5c40146aa49669b1a752585a0abe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 11 Jun 2013 12:57:03 -0700 Subject: [PATCH] Optimize SVG import for clipped groups. --- src/svg/SVGImport.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/svg/SVGImport.js b/src/svg/SVGImport.js index 2407281c..7802fbf0 100644 --- a/src/svg/SVGImport.js +++ b/src/svg/SVGImport.js @@ -345,7 +345,12 @@ new function() { if (clip) { clip = clip.clone(); clip.setClipMask(true); - return new Group(clip, item); + // If item is already a group, move the clip-path inside + if (item instanceof Group) { + item.insertChild(0, clip); + } else { + return new Group(clip, item); + } } },