From 07c2ce874351a89084df07d694e0461875367380 Mon Sep 17 00:00:00 2001 From: Ray Clark Date: Mon, 3 Oct 2022 00:30:00 +1100 Subject: [PATCH 1/2] Fixed flight event labels getting cut off --- swing/src/net/sf/openrocket/gui/plot/SimulationPlot.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/swing/src/net/sf/openrocket/gui/plot/SimulationPlot.java b/swing/src/net/sf/openrocket/gui/plot/SimulationPlot.java index 9bcb0253f..5d866dabc 100644 --- a/swing/src/net/sf/openrocket/gui/plot/SimulationPlot.java +++ b/swing/src/net/sf/openrocket/gui/plot/SimulationPlot.java @@ -427,7 +427,7 @@ public class SimulationPlot { // Plot the markers if (config.getDomainAxisType() == FlightDataType.TYPE_TIME) { - + double markerWidth = 0.7; // Domain time is plotted as vertical markers for (int i = 0; i < eventTimes.size(); i++) { double t = eventTimes.get(i); @@ -441,6 +441,10 @@ public class SimulationPlot { m.setAlpha(0.7f); m.setLabelFont(new Font("Dialog", Font.PLAIN, 13)); plot.addDomainMarker(m); + + if (t > plot.getDomainAxis().getUpperBound() - markerWidth) { + plot.setDomainAxis(new PresetNumberAxis(plot.getDomainAxis().getLowerBound(), t + markerWidth)); + } } } else { From caff69e01f6cffa51aa0424ed9f0d5ad54d4ffbc Mon Sep 17 00:00:00 2001 From: Ray Clark Date: Mon, 3 Oct 2022 00:43:54 +1100 Subject: [PATCH 2/2] Scaled marker width with plot size --- swing/src/net/sf/openrocket/gui/plot/SimulationPlot.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swing/src/net/sf/openrocket/gui/plot/SimulationPlot.java b/swing/src/net/sf/openrocket/gui/plot/SimulationPlot.java index 5d866dabc..9900305b4 100644 --- a/swing/src/net/sf/openrocket/gui/plot/SimulationPlot.java +++ b/swing/src/net/sf/openrocket/gui/plot/SimulationPlot.java @@ -427,7 +427,8 @@ public class SimulationPlot { // Plot the markers if (config.getDomainAxisType() == FlightDataType.TYPE_TIME) { - double markerWidth = 0.7; + double markerWidth = 0.01 * plot.getDomainAxis().getUpperBound(); + // Domain time is plotted as vertical markers for (int i = 0; i < eventTimes.size(); i++) { double t = eventTimes.get(i);