Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibGfx+LibPDF: Add support for stroke dash patterns #25311

Merged
merged 4 commits into from
Nov 7, 2024

Conversation

nico
Copy link
Contributor

@nico nico commented Nov 7, 2024

This adds support for dash patterns to Path::stroke_to_fill().
This is used in PDFs, <canvas>, and <svg>.

The implementation is based on the <canvas> spec. It seems to do
the right thing for PDF files too.

This is hooked up in LibPDF. Future commits will do <canvas> and <svg>.

This adds support for dash patterns to Path::stroke_to_fill().
This is used in PDFs, <canvas>, and <svg>.

The implementation is based on the <canvas> spec. It seems to do
the right thing for PDF files too.

(This commit only adds the feature to LibGfx. Future commits will
hook this up for PDF, <canvas>, and <svg>.)
We used to store them as ints, which threw away information.
In practice, files do use fractional values for these.
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Nov 7, 2024
@nico
Copy link
Contributor Author

nico commented Nov 7, 2024

The new Tests/LibPDF/paths.pdf, before:

out

After:

out-after

Before:

Screenshot 2024-11-06 at 10 37 37 AM

After:

Screenshot 2024-11-06 at 10 41 26 AM

Before:

Screenshot 2024-11-06 at 7 22 12 PM

After:

Screenshot 2024-11-06 at 7 20 51 PM

Before:

Screenshot 2024-11-06 at 7 22 08 PM

After:

Screenshot 2024-11-06 at 7 20 57 PM

@nico
Copy link
Contributor Author

nico commented Nov 7, 2024

Oh, and of course, before:

Screenshot 2024-11-06 at 7 51 53 AM

After:

Screenshot 2024-11-06 at 7 55 50 AM

@nico nico merged commit e56b7bb into SerenityOS:master Nov 7, 2024
14 checks passed
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label Nov 7, 2024
@nico nico deleted the gfx-stroke-dash branch November 7, 2024 14:12
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