Skip to content

Paint uncolored tiling patterns in the color selected with the pattern - #578

Merged
Velli20 merged 1 commit into
mainfrom
fix-uncolored-pattern-color
Oct 18, 2026
Merged

Velli20 merged 1 commit into
mainfrom
fix-uncolored-pattern-color

Conversation

@Velli20

@Velli20 Velli20 commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Uncolored (PaintType 2) tiling pattern cells were recorded on a fresh graphics state, so their shapes painted black instead of in the color passed to scn/SCN with the pattern.
  • record_content_stream takes an optional cell_color that seeds the recording's fill and stroke color; compute_shader passes the current fill (or stroke) color for uncolored patterns. Colored patterns and soft masks are unchanged.

Test plan

  • cargo test -p pdf-canvas
  • cargo clippy -p pdf-canvas --all-targets
  • Render path_5_pattern.pdf: the UnColorPattern shapes show green / purple / red / teal suits, as PDFium does

🤖 Generated with Claude Code

The cell of a PaintType 2 tiling pattern was recorded on a fresh graphics
state, so its shapes were painted black instead of in the color given to
scn/SCN together with the pattern. Seed the recording's fill and stroke
color with that color.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Velli20
Velli20 merged commit 8eb2b31 into main Oct 18, 2026
10 checks passed
@Velli20
Velli20 deleted the fix-uncolored-pattern-color branch October 18, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant