Skip to content

Conversation

BeastLe9enD
Copy link

@BeastLe9enD BeastLe9enD commented Jul 26, 2025

Makes it possible to draw rect shapes with better precision. For example, in my case, I am drawing a rect with scaling via TSTransform, and I want the rect to preserve the same corner radius at different scale resolutions. When using CornerRadius, it obviously doesn't have enough precision. I made the change with as few modifications as possible, only affecting a few parts. Of course, it's a breaking change, but since it's only inside the epaint part and not the egui part, I think it's acceptable.

Copy link

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

@emilk
Copy link
Owner

emilk commented Aug 5, 2025

So the rounding to closest integer is visible when you zoom in and out? Can you maybe show a video demonstrating this?

The reason we use u8 is to reduce the size of the RectShape (see the failing tests), but there are other solutions we could consider (like F16)

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.

2 participants