Skip to content

Use u8 in Rounding, and introduce Roundingf - #5563

Merged
emilk merged 3 commits into
masterfrom
emilk/compress-rounding
Jan 2, 2025
Merged

emilk merged 3 commits into
masterfrom
emilk/compress-rounding

Conversation

@emilk

@emilk emilk commented Jan 2, 2025

Copy link
Copy Markdown
Owner

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.

@github-actions

github-actions Bot commented Jan 2, 2025

Copy link
Copy Markdown

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
@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