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

rounded corners don't scale properly in the new pan zoom demo #4152

Closed
CrazyCraftix opened this issue Mar 9, 2024 · 0 comments · Fixed by #4161
Closed

rounded corners don't scale properly in the new pan zoom demo #4152

CrazyCraftix opened this issue Mar 9, 2024 · 0 comments · Fixed by #4161
Labels
bug Something is broken

Comments

@CrazyCraftix
Copy link
Contributor

Describe the bug
Rounded corners inside the new pan zoom demo don't scale properly when zooming.

To Reproduce
In the demo code, increase the corner radius of the egui::Frame from 4.0 to 20.0 (it is barely noticeable otherwise).
Zoom in and out.

Expected behavior
When zooming, the corner radius should stay consistent in relation to the rest of the shape.

Screenshots
wrong_corner_scaling

Additional context
Multiplying the radius by transform.scaling in the demo code seems to fix the issue, however I'd expect this to be handled automatically.
I suppose this was simply overlooked in #3906.
I'd fix it myself but I've barely started using egui, so I'll leave it to the professionals :)

@CrazyCraftix CrazyCraftix added the bug Something is broken label Mar 9, 2024
emilk pushed a commit that referenced this issue Mar 12, 2024
When scaling an `egui::Shape` of variant `Rect` using the new
`transform` function, corner rounding isn't taken into account.

The fix is to multiply the rounding by the scaling factor.

* Closes <#4152>
hacknus pushed a commit to hacknus/egui that referenced this issue Oct 30, 2024
When scaling an `egui::Shape` of variant `Rect` using the new
`transform` function, corner rounding isn't taken into account.

The fix is to multiply the rounding by the scaling factor.

* Closes <emilk#4152>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant