SVG clip intersections and operators #9673
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #8496
When a new clipping path is set, the result should be the intersection of the new path with the previous clipping path. Currently the SVG backend incorrectly just replaces the previous clipping path with the new one.
SVG can automatically compute the intersection. It's easiest to add a
clip-path
attribute to aclipPath
element. The SVG Recommendation says:In issue #8496 a text-shaped clipping path is first set and then a larger rectangular path. This is repeated in a number of texts on the page.
issue8496_reduced.pdf
The reduced PDF should show a black letter 'a', not a rectangle.
I have also fixed all the painting operators
S s f f* B B* b b* n
that should generate clipping paths. Previously onlyn
has worked. Here is a file to test these:clip_operators.pdf