mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
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 <https://github.com/emilk/egui/issues/7348> * [x] I have followed the instructions in the PR template
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user