From 4a330de53d2a79a65e3920f80701c7b8634a3ced Mon Sep 17 00:00:00 2001 From: CrazyCraftix <43807375+CrazyCraftix@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:14:24 +0100 Subject: [PATCH] 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 --- crates/epaint/src/shape.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/epaint/src/shape.rs b/crates/epaint/src/shape.rs index 0aeec552..fefae6c9 100644 --- a/crates/epaint/src/shape.rs +++ b/crates/epaint/src/shape.rs @@ -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;