Merge pull request #2049 from SiboVG/issue-2047
[#2047] Fix pod set & booster markers
This commit is contained in:
commit
98dccd868a
@ -181,10 +181,8 @@ public abstract class ComponentAssembly extends RocketComponent implements Axial
|
|||||||
public void updateBounds() {
|
public void updateBounds() {
|
||||||
// currently only updates the length
|
// currently only updates the length
|
||||||
this.length = 0;
|
this.length = 0;
|
||||||
Iterator<RocketComponent> childIterator = this.getChildren().iterator();
|
for (RocketComponent curChild : this.getChildren()) {
|
||||||
while (childIterator.hasNext()) {
|
if (curChild.isAfter()) {
|
||||||
RocketComponent curChild = childIterator.next();
|
|
||||||
if(curChild.isAfter()){
|
|
||||||
this.length += curChild.getLength();
|
this.length += curChild.getLength();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import net.sf.openrocket.rocketcomponent.ParallelStage;
|
|||||||
import net.sf.openrocket.rocketcomponent.PodSet;
|
import net.sf.openrocket.rocketcomponent.PodSet;
|
||||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||||
import net.sf.openrocket.rocketcomponent.position.AxialMethod;
|
import net.sf.openrocket.rocketcomponent.position.AxialMethod;
|
||||||
|
import net.sf.openrocket.rocketcomponent.position.RadiusMethod;
|
||||||
import net.sf.openrocket.util.Color;
|
import net.sf.openrocket.util.Color;
|
||||||
import net.sf.openrocket.util.Transformation;
|
import net.sf.openrocket.util.Transformation;
|
||||||
|
|
||||||
@ -30,8 +31,10 @@ public class ComponentAssemblyShapes extends RocketComponentShape {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Correct the radius to be at the "reference point" dictated by the component's radius offset.
|
// Correct the radius to be at the "reference point" dictated by the component's radius offset.
|
||||||
double boundingRadius = assembly.getBoundingRadius();
|
if (assembly.getRadiusMethod() == RadiusMethod.RELATIVE) {
|
||||||
correctedTransform = correctedTransform.applyTransformation(new Transformation(0, -boundingRadius, 0));
|
double boundingRadius = assembly.getBoundingRadius();
|
||||||
|
correctedTransform = correctedTransform.applyTransformation(new Transformation(0, -boundingRadius, 0));
|
||||||
|
}
|
||||||
|
|
||||||
double markerRadius = getDisplayRadius(component);
|
double markerRadius = getDisplayRadius(component);
|
||||||
Shape[] s = EmptyShapes.getShapesSideWithSelectionSquare(correctedTransform, markerRadius);
|
Shape[] s = EmptyShapes.getShapesSideWithSelectionSquare(correctedTransform, markerRadius);
|
||||||
@ -55,8 +58,11 @@ public class ComponentAssemblyShapes extends RocketComponentShape {
|
|||||||
ComponentAssembly assembly = (ComponentAssembly) component;
|
ComponentAssembly assembly = (ComponentAssembly) component;
|
||||||
|
|
||||||
// Correct the radius to be at the "reference point" dictated by the component's radius offset.
|
// Correct the radius to be at the "reference point" dictated by the component's radius offset.
|
||||||
double boundingRadius = assembly.getBoundingRadius();
|
Transformation correctedTransform = transformation;
|
||||||
Transformation correctedTransform = transformation.applyTransformation(new Transformation(0, -boundingRadius, 0));
|
if (assembly.getRadiusMethod() == RadiusMethod.RELATIVE) {
|
||||||
|
double boundingRadius = assembly.getBoundingRadius();
|
||||||
|
correctedTransform = correctedTransform.applyTransformation(new Transformation(0, -boundingRadius, 0));
|
||||||
|
}
|
||||||
|
|
||||||
double markerRadius = getDisplayRadius(component);
|
double markerRadius = getDisplayRadius(component);
|
||||||
Shape[] s = EmptyShapes.getShapesBackWithSelectionSquare(correctedTransform, markerRadius);
|
Shape[] s = EmptyShapes.getShapesBackWithSelectionSquare(correctedTransform, markerRadius);
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
package net.sf.openrocket.gui.rocketfigure;
|
||||||
|
|
||||||
|
public class ParallelStageShapes extends ComponentAssemblyShapes {
|
||||||
|
// Everything is handled by the ComponentAssemblyShapes class.
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
package net.sf.openrocket.gui.rocketfigure;
|
||||||
|
|
||||||
|
public class PodSetShapes extends ComponentAssemblyShapes {
|
||||||
|
// Everything is handled by the ComponentAssemblyShapes class.
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user