From 628a593550f150e43d640b9139a3d25c2894024b Mon Sep 17 00:00:00 2001 From: Billy Olsen Date: Wed, 2 Dec 2020 19:38:44 -0700 Subject: [PATCH] Fix offset locations of mass components 2D side view renderings of mass components within body tubes were adjusted forward based off the radius of the object. This change corrects the X position adjustement and makes it consistent with 15.03 and 3D renderings. Closes #785 Closes #828 Signed-off-by: Billy Olsen --- .../net/sf/openrocket/gui/rocketfigure/MassComponentShapes.java | 2 +- .../src/net/sf/openrocket/gui/rocketfigure/ParachuteShapes.java | 2 +- .../src/net/sf/openrocket/gui/rocketfigure/StreamerShapes.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/MassComponentShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/MassComponentShapes.java index c770509f2..f9067e3ed 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/MassComponentShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/MassComponentShapes.java @@ -33,7 +33,7 @@ public class MassComponentShapes extends RocketComponentShape { radialDistance * Math.sin(radialAngleRadians)); final Coordinate renderPosition = transformation.transform(localPosition); - Shape[] s = {new RoundRectangle2D.Double(renderPosition.x - radius, renderPosition.y - radius, length, 2*radius, arc, arc)}; + Shape[] s = {new RoundRectangle2D.Double(renderPosition.x, renderPosition.y - radius, length, 2*radius, arc, arc)}; final MassComponent.MassComponentType type = ((MassComponent)component).getMassComponentType(); switch (type) { diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/ParachuteShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/ParachuteShapes.java index 6edf1aa7c..5b68d9759 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/ParachuteShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/ParachuteShapes.java @@ -29,7 +29,7 @@ public class ParachuteShapes extends RocketComponentShape { radialDistance * Math.sin(radialAngleRadians)); final Coordinate renderPosition = transformation.transform(localPosition); - Shape[] s = {new RoundRectangle2D.Double(renderPosition.x - radius, renderPosition.y - radius, length, 2*radius, arc, arc)}; + Shape[] s = {new RoundRectangle2D.Double(renderPosition.x, renderPosition.y - radius, length, 2*radius, arc, arc)}; return RocketComponentShape.toArray( addSymbol(s), component); } diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/StreamerShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/StreamerShapes.java index 4f50494e4..b14f7b724 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/StreamerShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/StreamerShapes.java @@ -28,7 +28,7 @@ public class StreamerShapes extends RocketComponentShape { radialDistance * Math.sin(radialAngleRadians)); final Coordinate renderPosition = transformation.transform(localPosition); - Shape[] s = {new RoundRectangle2D.Double(renderPosition.x - radius, renderPosition.y - radius, length, 2*radius, arc, arc)}; + Shape[] s = {new RoundRectangle2D.Double(renderPosition.x, renderPosition.y - radius, length, 2*radius, arc, arc)}; return RocketComponentShape.toArray(addSymbol(s), component); }