Skip to content

Commit

Permalink
Fix: Popup incorrectly calculates possible min width of popup causing…
Browse files Browse the repository at this point in the history
… panic (#5208)

Fix: Popup incorrectly calculates possible min width of popup causing
panic

* Closes #5206
  • Loading branch information
rustbasic authored Oct 29, 2024
1 parent c7d46ac commit 926799a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/egui/src/containers/popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ pub fn popup_above_or_below_widget<R>(

let frame = Frame::popup(parent_ui.style());
let frame_margin = frame.total_margin();
let inner_width = widget_response.rect.width() - frame_margin.sum().x;
let inner_width = (widget_response.rect.width() - frame_margin.sum().x).max(0.0);

parent_ui.ctx().pass_state_mut(|fs| {
fs.layers
Expand Down

0 comments on commit 926799a

Please sign in to comment.