Merge pull request #1711 from raynichc/fixes/SimulationPlot

Fixed flight event labels getting cut off
This commit is contained in:
Sibo Van Gool 2022-10-09 17:38:46 +02:00 committed by GitHub
commit 176cab68db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -427,6 +427,7 @@ public class SimulationPlot {
// Plot the markers
if (config.getDomainAxisType() == FlightDataType.TYPE_TIME) {
double markerWidth = 0.01 * plot.getDomainAxis().getUpperBound();
// Domain time is plotted as vertical markers
for (int i = 0; i < eventTimes.size(); i++) {
@ -441,6 +442,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 {