Skip to content

Commit

Permalink
Keep transparent elements inside <clipPath>
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound committed Feb 24, 2021
1 parent d14315b commit 9d67586
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/removeHiddenElems.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ exports.fn = function (item, params) {
// http://www.w3.org/TR/SVG11/masking.html#ObjectAndGroupOpacityProperties
if (
params.opacity0 &&
item.hasAttr('opacity', '0')
item.hasAttr('opacity', '0') &&
// transparent element inside clipPath still affect clipped elements
item.closestElem('clipPath') == null
) return false;

// Circles with zero radius
Expand Down
17 changes: 17 additions & 0 deletions test/plugins/removeHiddenElems.11.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9d67586

Please sign in to comment.