Skip to content

Restore the remembered fill color in restore() - #1852

Open
kroplabeskidu wants to merge 1 commit into
foliojs:masterfrom
kroplabeskidu:restore-fill-color
Open

kroplabeskidu wants to merge 1 commit into
foliojs:masterfrom
kroplabeskidu:restore-fill-color

Conversation

@kroplabeskidu

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix. Fixes #1199

The text wrapper sets _fillColor again on each new page, but restore() left that value alone. So after doc.save().rect(...).fill('#f00').restore(), text started in black and turned red from the second page on. save() and restore() now keep _fillColor too, so new pages get the same color as the graphics state.

This changes what a page break does after restore(), but only towards what the first page already shows.

Checklist:

  • Unit Tests
  • Update CHANGELOG.md
  • Ready to be merged

This branch has not been deployed

No deployments
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.

Text flowing onto next page appears in fill colour

1 participant