1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Make sure plot size is positive (#4429)

* Closes #4425 

Fix: in Plot, Minimum values for screen protection.
This commit is contained in:
rustbasic
2024-05-11 23:49:27 +09:00
committed by GitHub
parent e06b225dab
commit 3b3ce22adc
2 changed files with 7 additions and 1 deletions

View File

@@ -97,11 +97,13 @@ impl super::View for ContextMenus {
egui::Grid::new("button_grid").show(ui, |ui| {
ui.add(
egui::DragValue::new(&mut self.width)
.clamp_range(0.0..=f32::INFINITY)
.speed(1.0)
.prefix("Width: "),
);
ui.add(
egui::DragValue::new(&mut self.height)
.clamp_range(0.0..=f32::INFINITY)
.speed(1.0)
.prefix("Height: "),
);