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:
parent
fb5fe645be
commit
53d8c48b4f
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue