From fdaac16e4a5515472f01de276a5d5fc39b5af737 Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Wed, 30 Apr 2025 10:40:50 +0200 Subject: [PATCH] Fix image button panicking with tiny `available_space` (#6900) * Fixes * [x] I have followed the instructions in the PR template --- crates/egui/src/widgets/button.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/egui/src/widgets/button.rs b/crates/egui/src/widgets/button.rs index 2a85a164..a75997ef 100644 --- a/crates/egui/src/widgets/button.rs +++ b/crates/egui/src/widgets/button.rs @@ -249,7 +249,7 @@ impl Widget for Button<'_> { ) } else { ( - ui.available_size() - 2.0 * button_padding, + (ui.available_size() - 2.0 * button_padding).at_least(Vec2::ZERO), default_font_height(), ) };