From 3d02766d41ab987a1a508fa8564af305138d240c Mon Sep 17 00:00:00 2001 From: SiboVG Date: Wed, 18 Jan 2023 00:13:04 +0100 Subject: [PATCH] [#1980] Render booster markers even if no children --- .../rocketcomponent/FlightConfiguration.java | 19 +++++++++++++++++-- .../gui/scalefigure/RocketFigure.java | 9 +++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java index 271e1fb59..44089a499 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java @@ -67,6 +67,7 @@ public class FlightConfiguration implements FlightConfigurableParameter preloadStageActiveness = null; final private Collection activeMotors = new ConcurrentLinkedQueue(); final private InstanceMap activeInstances = new InstanceMap(); + final private InstanceMap extraRenderInstances = new InstanceMap(); // Extra instances to be rendered, besides the active instances private int boundsModID = -1; private BoundingBox cachedBoundsAerodynamic = new BoundingBox(); // Bounding box of all aerodynamic components @@ -288,7 +289,7 @@ public class FlightConfiguration implements FlightConfigurableParameter 0 && + return stage != null && stage.getChildCount() > 0 && // Stages with no children are marked as inactive stages.get(stageNumber) != null && stages.get(stageNumber).active; } @@ -398,6 +399,15 @@ public class FlightConfiguration implements FlightConfigurableParameter> entry : config.getActiveInstances().entrySet()) { + addShapesFromInstanceEntries(allShapes, config.getActiveInstances().entrySet()); + addShapesFromInstanceEntries(allShapes, config.getExtraRenderInstances().entrySet()); + } + + private void addShapesFromInstanceEntries(PriorityQueue allShapes, Set>> entries) { + for (Entry> entry : entries) { final RocketComponent comp = entry.getKey(); // Only draw pod sets and boosters when they are selected @@ -409,7 +414,7 @@ public class RocketFigure extends AbstractScaleFigure { } } } - + /** * Gets the shapes required to draw the component. *