Skip to content

Commit

Permalink
egui: Fixed incorrect Window resize corner rounding selection
Browse files Browse the repository at this point in the history
  • Loading branch information
varphone committed Feb 13, 2024
1 parent acc9ddc commit 33dbfb4
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions crates/egui/src/containers/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,21 +616,20 @@ fn paint_resize_corner(
stroke: impl Into<Stroke>,
rounding: impl Into<Rounding>,
) {
let corner = if possible.resize_right && possible.resize_bottom {
Align2::RIGHT_BOTTOM
let stroke = stroke.into();
let rounding = rounding.into();
let (corner, radius) = if possible.resize_right && possible.resize_bottom {
(Align2::RIGHT_BOTTOM, rounding.se)
} else if possible.resize_left && possible.resize_bottom {
Align2::LEFT_BOTTOM
(Align2::LEFT_BOTTOM, rounding.sw)
} else if possible.resize_left && possible.resize_top {
Align2::LEFT_TOP
(Align2::LEFT_TOP, rounding.nw)
} else if possible.resize_right && possible.resize_top {
Align2::RIGHT_TOP
(Align2::RIGHT_TOP, rounding.ne)
} else {
return;
};

let stroke = stroke.into();
let rounding = rounding.into();
let radius = rounding.se;
// Adjust the corner offset to accommodate the stroke width and window rounding
let offset = if radius <= 2.0 && stroke.width < 2.0 {
2.0
Expand Down

0 comments on commit 33dbfb4

Please sign in to comment.