From 05d68d26bde45f3e1dce4987ac35c5d9df1450aa Mon Sep 17 00:00:00 2001 From: Saecki Date: Mon, 26 Sep 2022 17:16:10 +0200 Subject: [PATCH] fix: default to changing y axis when changing data aspect --- crates/egui/src/widgets/plot/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/egui/src/widgets/plot/mod.rs b/crates/egui/src/widgets/plot/mod.rs index 9e82d256..1f5ab1be 100644 --- a/crates/egui/src/widgets/plot/mod.rs +++ b/crates/egui/src/widgets/plot/mod.rs @@ -831,8 +831,10 @@ impl Plot { if let Some(linked_axes) = &linked_axes { let change_x = linked_axes.link_y && !linked_axes.link_x; transform.set_aspect_by_changing_axis(data_aspect as f64, change_x); - } else { + } else if auto_bounds.any() { transform.set_aspect_by_expanding(data_aspect as f64); + } else { + transform.set_aspect_by_changing_axis(data_aspect as f64, false); } }