Closed
Conversation
This does not support maskContentUnits="objectBoundingBox" but should support everything else. The SVG spec supports masking using images as the mask; it does not appear PDF is doing this but may be a bug in this code so requires further investigation.
- Properly structure soft_mask block with nested calls - Process mask children to generate mask pattern - Use push/pop_call_position to manage call context - Add save_graphics_state for proper state management The previous partial implementation wasn't correctly handling the soft_mask API which expects drawing commands to be nested within the block. This fix ensures masks work correctly with circular and other mask shapes.
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR completes the partial mask element implementation that was started but not finished.
Changes
apply_maskmethod to properly work with Prawn'ssoft_maskAPIProblem
The previous partial implementation wasn't correctly handling the soft_mask API which expects drawing commands to be nested within the block. This caused masks to not render properly in PDFs.
Solution
The fix ensures masks work correctly by:
save_graphics_statefor proper state managementTesting
Tested with various mask types including:
All tests pass and masks now render correctly in PDFs.
Fixes the incomplete mask implementation from commit 8fe7d2f.