Skip to content

Commit

Permalink
Merge pull request #9673 from janpe2/svg-clip
Browse files Browse the repository at this point in the history
SVG clip intersections and operators
  • Loading branch information
timvandermeij authored Apr 22, 2018
2 parents 2dc4af5 + fe2cf2f commit c5c06bf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/display/svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,8 @@ SVGGraphics = (function SVGGraphicsClosure() {
this.extraStack.forEach(function (prev) {
prev.clipGroup = null;
});
// Intersect with the previous clipping path.
clipPath.setAttributeNS(null, 'clip-path', current.activeClipUrl);
}
current.activeClipUrl = 'url(#' + clipId + ')';

Expand Down Expand Up @@ -1069,6 +1071,7 @@ SVGGraphics = (function SVGGraphicsClosure() {
if (current.element) {
current.element.setAttributeNS(null, 'fill', current.fillColor);
current.element.setAttributeNS(null, 'fill-opacity', current.fillAlpha);
this.endPath();
}
},

Expand All @@ -1092,6 +1095,8 @@ SVGGraphics = (function SVGGraphicsClosure() {
pf(current.dashPhase) + 'px');

current.element.setAttributeNS(null, 'fill', 'none');

this.endPath();
}
},

Expand Down

0 comments on commit c5c06bf

Please sign in to comment.