Fix scaling of rounded corners for rect shape (#4152) (#4161)

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 <https://github.com/emilk/egui/issues/4152>
This commit is contained in:
CrazyCraftix 2024-03-12 11:14:24 +01:00 committed by GitHub
parent d0a6bbf2b8
commit 4a330de53d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -403,6 +403,7 @@ impl Shape {
Self::Rect(rect_shape) => {
rect_shape.rect = transform * rect_shape.rect;
rect_shape.stroke.width *= transform.scaling;
rect_shape.rounding *= transform.scaling;
}
Self::Text(text_shape) => {
text_shape.pos = transform * text_shape.pos;