Merge pull request #2052 from SiboVG/issue-2050
[#2050] Fix carets rotation in top view
This commit is contained in:
commit
993f193a20
@ -126,9 +126,16 @@ public class RocketFigure extends AbstractScaleFigure {
|
|||||||
fireChangeEvent();
|
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() {
|
public double getRotation() {
|
||||||
return rotation;
|
return getRotation(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRotation(double rot) {
|
public void setRotation(double rot) {
|
||||||
@ -299,10 +306,8 @@ public class RocketFigure extends AbstractScaleFigure {
|
|||||||
Coordinate[] mountLocations = mount.getLocations();
|
Coordinate[] mountLocations = mount.getLocations();
|
||||||
|
|
||||||
double mountLength = mountComponent.getLength();
|
double mountLength = mountComponent.getLength();
|
||||||
// System.err.println("Drawing Motor: "+motor.getDesignation()+" (x"+mountLocations.length+")");
|
|
||||||
for (Coordinate curMountLocation : mountLocations) {
|
for (Coordinate curMountLocation : mountLocations) {
|
||||||
Coordinate curMotorLocation = curMountLocation.add(mountLength - motorLength + mount.getMotorOverhang(), 0, 0);
|
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:
|
// rotate by figure's axial rotation:
|
||||||
curMotorLocation = getFigureRotation().transform(curMotorLocation);
|
curMotorLocation = getFigureRotation().transform(curMotorLocation);
|
||||||
|
@ -732,7 +732,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
|||||||
double cgy = Double.NaN;
|
double cgy = Double.NaN;
|
||||||
double cpx = Double.NaN;
|
double cpx = Double.NaN;
|
||||||
double cpy = Double.NaN;
|
double cpy = Double.NaN;
|
||||||
final double rotation = rotationModel.getValue();
|
final double rotation = figure.getRotation(true);
|
||||||
|
|
||||||
FlightConfiguration curConfig = document.getSelectedConfiguration();
|
FlightConfiguration curConfig = document.getSelectedConfiguration();
|
||||||
// TODO: MEDIUM: User-definable conditions
|
// TODO: MEDIUM: User-definable conditions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user