From fe2cf2f73feb6e00d3e54b6c7a9f0784ce58c1f9 Mon Sep 17 00:00:00 2001 From: Jani Pehkonen Date: Tue, 17 Apr 2018 19:20:29 +0300 Subject: [PATCH] SVG clip intersections and operators --- src/display/svg.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/display/svg.js b/src/display/svg.js index bf3b7f13d..c99390006 100644 --- a/src/display/svg.js +++ b/src/display/svg.js @@ -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 + ')'; @@ -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(); } }, @@ -1092,6 +1095,8 @@ SVGGraphics = (function SVGGraphicsClosure() { pf(current.dashPhase) + 'px'); current.element.setAttributeNS(null, 'fill', 'none'); + + this.endPath(); } },