Skip to content

Fix SVG artifacts when using tiny-skia and DPI scaling #2954

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

semiversus
Copy link

@semiversus semiversus commented May 22, 2025

This pull request fixes two issues when tiny-skia is used and DPI scaling factor is unequal to 1.0.

Changes done to fix these issues:

  • Vector pipeline .draw gets physical_bounds but needs *bounds
  • The SVG is rendered with size defined by logical size and then the pixmap is scaled up. Change this to rendering in physical size.
  • Arguments with _ prefix get the prefix removed, as the arguments are used.

@semiversus semiversus changed the title Fix scaling artifacts Fix SVG artifacts when using tiny-skia and DPI scaling May 22, 2025
@semiversus
Copy link
Author

Using the minimal repo from @njust (https://github.com/njust/iced-svg-issue) here are the results:

Scale 1.0
scale_1 0

Scale 2.0 (with original 1.13.1)
scale_2 0_fail

Scale 2.0 with this fix
scale_2 0_working

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