diff --git a/swing/src/net/sf/openrocket/gui/scalefigure/RocketFigure.java b/swing/src/net/sf/openrocket/gui/scalefigure/RocketFigure.java index 0925aca8a..df1ebb08d 100644 --- a/swing/src/net/sf/openrocket/gui/scalefigure/RocketFigure.java +++ b/swing/src/net/sf/openrocket/gui/scalefigure/RocketFigure.java @@ -125,10 +125,17 @@ public class RocketFigure extends AbstractScaleFigure { updateFigure(); fireChangeEvent(); } - + + public double getRotation(boolean applyTopViewOffset) { + if (applyTopViewOffset && currentViewType == RocketPanel.VIEW_TYPE.TopView) { + return this.rotation - Math.PI/2; + } else { + return this.rotation; + } + } public double getRotation() { - return rotation; + return getRotation(false); } public void setRotation(double rot) { @@ -142,7 +149,7 @@ public class RocketFigure extends AbstractScaleFigure { private Transformation getFigureRotation() { if (currentViewType == RocketPanel.VIEW_TYPE.TopView) { - return this.axialRotation.applyTransformation(Transformation.rotate_x(-Math.PI / 2)); + return this.axialRotation.applyTransformation(Transformation.rotate_x(-Math.PI/2)); } else { return this.axialRotation; } @@ -299,10 +306,8 @@ public class RocketFigure extends AbstractScaleFigure { Coordinate[] mountLocations = mount.getLocations(); double mountLength = mountComponent.getLength(); -// System.err.println("Drawing Motor: "+motor.getDesignation()+" (x"+mountLocations.length+")"); for (Coordinate curMountLocation : mountLocations) { Coordinate curMotorLocation = curMountLocation.add(mountLength - motorLength + mount.getMotorOverhang(), 0, 0); -// System.err.println(String.format(" mount instance: %s => %s", curMountLocation.toString(), curMotorLocation.toString() )); // rotate by figure's axial rotation: curMotorLocation = getFigureRotation().transform(curMotorLocation); diff --git a/swing/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java b/swing/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java index e0bd87f1d..08ec2e93a 100644 --- a/swing/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java +++ b/swing/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java @@ -732,7 +732,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change double cgy = Double.NaN; double cpx = Double.NaN; double cpy = Double.NaN; - final double rotation = rotationModel.getValue(); + final double rotation = figure.getRotation(true); FlightConfiguration curConfig = document.getSelectedConfiguration(); // TODO: MEDIUM: User-definable conditions