From c462122a457781590710a28061fadcf79debacf9 Mon Sep 17 00:00:00 2001 From: JoePfeiffer Date: Sat, 28 Sep 2024 06:20:52 -0600 Subject: [PATCH] update axis min and max to reflect all branches, not just first branch --- .../src/main/java/info/openrocket/swing/gui/plot/Plot.java | 7 +++---- .../info/openrocket/swing/gui/plot/SimulationPlot.java | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/swing/src/main/java/info/openrocket/swing/gui/plot/Plot.java b/swing/src/main/java/info/openrocket/swing/gui/plot/Plot.java index ef62eb379..7c24334aa 100644 --- a/swing/src/main/java/info/openrocket/swing/gui/plot/Plot.java +++ b/swing/src/main/java/info/openrocket/swing/gui/plot/Plot.java @@ -73,7 +73,7 @@ public abstract class Plot, C extend protected final List renderers = new ArrayList<>(); protected final LegendItems legendItems; protected final XYSeriesCollection[] data; - protected final C filledConfig; // Configuration after using 'fillAutoAxes' + protected final C filledConfig; // Configuration after using 'fillAutoAxes' and 'fitAxes' protected final JFreeChart chart; @@ -124,9 +124,8 @@ public abstract class Plot, C extend int seriesCount = 0; // Compute the axes based on the min and max value of all branches - C plotConfig = filledConfig.cloneConfiguration(); - plotConfig.fitAxes(allBranches); - List minMaxAxes = plotConfig.getAllAxes(); + filledConfig.fitAxes(allBranches); + List minMaxAxes = filledConfig.getAllAxes(); // Create the XYSeries objects from the flight data and store into the collections String[] axisLabel = new String[2]; diff --git a/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java b/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java index 93f5fe269..687d710db 100644 --- a/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java +++ b/swing/src/main/java/info/openrocket/swing/gui/plot/SimulationPlot.java @@ -274,10 +274,10 @@ public class SimulationPlot extends Plot