From 11de996460742af8a697b26ef27d95b47fb3cefc Mon Sep 17 00:00:00 2001 From: gravl4 <64896051+gravl4@users.noreply.github.com> Date: Mon, 10 Feb 2025 19:45:33 +0700 Subject: [PATCH] auto bounds X/Y indepented X and Y was link in aoutobound mode. problem example: y 1.0 1.0 1.0 x 17777780000 17777880000 17777980000 (as timestamp in us) autobounds Y is 10000000 --- egui_plot/src/transform.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/egui_plot/src/transform.rs b/egui_plot/src/transform.rs index 7f2b2dd..8ef55ca 100644 --- a/egui_plot/src/transform.rs +++ b/egui_plot/src/transform.rs @@ -300,8 +300,8 @@ impl PlotTransform { } else if bounds.width() <= 0.0 { new_bounds.set_x_center_width( bounds.center().x, - if bounds.is_valid_y() { - bounds.height() + if bounds.is_valid_x() { + bounds.width() } else { 1.0 }, @@ -313,8 +313,8 @@ impl PlotTransform { } else if bounds.height() <= 0.0 { new_bounds.set_y_center_height( bounds.center().y, - if bounds.is_valid_x() { - bounds.width() + if bounds.is_valid_y() { + bounds.height() } else { 1.0 },