Skip to content

Commit

Permalink
Fix min_width without custom rounding
Browse files Browse the repository at this point in the history
To match what it was before and make the animation look right.
  • Loading branch information
YgorSouza committed Nov 10, 2023
1 parent 95d2838 commit c0f9a6a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions crates/egui/src/widgets/progress_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ impl Widget for ProgressBar {
let rounding = rounding.unwrap_or_else(|| corner_radius.into());
ui.painter()
.rect(outer_rect, rounding, visuals.extreme_bg_color, Stroke::NONE);
let min_width = rounding
.sw
.at_least(rounding.nw)
.at_most(2.0 * corner_radius);
let min_width = 2.0 * rounding.sw.at_least(rounding.nw).at_most(corner_radius);
let filled_width = (outer_rect.width() * progress).at_least(min_width);
let inner_rect =
Rect::from_min_size(outer_rect.min, vec2(filled_width, outer_rect.height()));
Expand Down

0 comments on commit c0f9a6a

Please sign in to comment.