[#2485] Fix motor mount not hiding

This commit is contained in:
Ahanu Dewhirst 2024-07-17 22:30:29 +10:00
parent 2f524016de
commit 7751faccda
2 changed files with 8 additions and 1 deletions

View File

@ -214,7 +214,10 @@ public abstract class RocketRenderer {
if( null == motor ){
throw new NullPointerException(" null motor from configuration.getActiveMotors... this is a bug.");
}
if (!((RocketComponent) mount).isVisible()) {
continue;
}
double length = motor.getLength();
Coordinate[] position = ((RocketComponent) mount).toAbsolute(new Coordinate(((RocketComponent) mount)

View File

@ -326,6 +326,10 @@ public class RocketFigure extends AbstractScaleFigure {
double motorRadius = motor.getDiameter() / 2;
RocketComponent mountComponent = ((RocketComponent) mount);
if (!mountComponent.isVisible()) {
continue;
}
// <component>.getLocation() will return all the parent instances of this owning component, AND all of it's own instances as well.
// so, just draw a motor once for each Coordinate returned...
Coordinate[] mountLocations = mount.getLocations();