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

Use u8 in Rounding, and introduce Roundingf #5563

Merged
merged 3 commits into from
Jan 2, 2025
Merged

Conversation

emilk
Copy link
Owner

@emilk emilk commented Jan 2, 2025

As part of the work on adding a custom Border to everything, I want to make sure that the size of RectShape, Frame and the future Border is kept small (for performance reasons).

This PR changes the storage of the corner radius of rectangles from four f32 (one for each corner) into four u8. This mean the corner radius can only be an integer in the range 0-255 (in ui points). This should be enough for most people.

If you want to manipulate rounding using f32, there is a new Roundingf to fill that niche.

Copy link

github-actions bot commented Jan 2, 2025

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

@emilk emilk merged commit 249f8bc into master Jan 2, 2025
46 checks passed
@emilk emilk deleted the emilk/compress-rounding branch January 2, 2025 13:29
@emilk emilk added the performance Lower CPU/GPU usage (optimize) label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui epaint performance Lower CPU/GPU usage (optimize)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant