Skip to content

Conversation

emilk
Copy link
Owner

@emilk emilk commented May 21, 2025

The problem occurs when you want to render the same SVG at different scales, either at the same time in different parts of your UI, or at two different times (e.g. the DPI changes).

The solution is to use the SizeHint as part of the key.

However, when you have an SVG in a resizable container, that can lead to hundreds of versions of the same SVG. So new eviction code is added to handle this case.

@emilk emilk added bug Something is broken egui egui_extras labels May 21, 2025
Copy link

Preview available at https://egui-pr-preview.github.io/pr/7071-emilkfix-blurry-svg
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@emilk emilk force-pushed the emilk/fix-blurry-svg branch from 7637d27 to fb81f18 Compare May 21, 2025 17:53
@emilk emilk added the visuals Renderings / graphics releated label May 21, 2025
@emilk emilk merged commit b8334f3 into main May 21, 2025
48 checks passed
@emilk emilk deleted the emilk/fix-blurry-svg branch May 21, 2025 18:01
emilk added a commit to rerun-io/rerun that referenced this pull request May 21, 2025
This should unblock using svg for icons, thanks to
* emilk/egui#7071
darkwater pushed a commit to darkwater/egui that referenced this pull request Aug 24, 2025
* Closes emilk#3501

The problem occurs when you want to render the same SVG at different
scales, either at the same time in different parts of your UI, or at two
different times (e.g. the DPI changes).

The solution is to use the `SizeHint` as part of the key.

However, when you have an SVG in a resizable container, that can lead to
hundreds of versions of the same SVG. So new eviction code is added to
handle this case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is broken egui_extras egui visuals Renderings / graphics releated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple svg images render blurry

1 participant