From 53d8c48b4f54faaedd3077bb95202897eec502e5 Mon Sep 17 00:00:00 2001 From: YgorSouza <43298013+YgorSouza@users.noreply.github.com> Date: Tue, 12 Aug 2025 09:13:50 +0200 Subject: [PATCH] Fix panic on Stroke style editor widget (#7443) The infinite limit caused arithmetic issues when rendering the preview with very large values, which led to a panic. The new limit should still be higher than anyone would reasonably want to set a stroke width to, but not high enough to trigger a panic. * Closes * [x] I have followed the instructions in the PR template --- crates/egui/src/style.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/egui/src/style.rs b/crates/egui/src/style.rs index 68491d2d..aa24f472 100644 --- a/crates/egui/src/style.rs +++ b/crates/egui/src/style.rs @@ -2708,7 +2708,7 @@ impl Widget for &mut Stroke { let Stroke { width, color } = self; ui.horizontal(|ui| { - ui.add(DragValue::new(width).speed(0.1).range(0.0..=f32::INFINITY)) + ui.add(DragValue::new(width).speed(0.1).range(0.0..=1e9)) .on_hover_text("Width"); ui.color_edit_button_srgba(color);