From 15c00620bcc3e137c99b15268cd91b33271b7b78 Mon Sep 17 00:00:00 2001 From: Daniel_M_Williams Date: Sat, 1 Dec 2018 12:40:16 -0500 Subject: [PATCH 1/2] [fixes #474] Fin bounds include whole fin, even if it extends in front of the mount. --- .../net/sf/openrocket/gui/scalefigure/FinPointFigure.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/swing/src/net/sf/openrocket/gui/scalefigure/FinPointFigure.java b/swing/src/net/sf/openrocket/gui/scalefigure/FinPointFigure.java index e6b545e4b..550f71a98 100644 --- a/swing/src/net/sf/openrocket/gui/scalefigure/FinPointFigure.java +++ b/swing/src/net/sf/openrocket/gui/scalefigure/FinPointFigure.java @@ -348,8 +348,6 @@ public class FinPointFigure extends AbstractScaleFigure { // update subject (i.e. Fin) bounds finBounds_m = new BoundingBox().update(finset.getFinPoints()).toRectangle(); - // NOTE: the fin's forward root is pinned at 0,0 - finBounds_m.setRect(0, 0, finBounds_m.getWidth(), finBounds_m.getHeight()); // update to bound the parent body: SymmetricComponent parent = (SymmetricComponent)this.finset.getParent(); @@ -358,10 +356,12 @@ public class FinPointFigure extends AbstractScaleFigure { final double yParent = -parent.getRadius(xParent); // from parent centerline to fin front. final double rParent = Math.max(parent.getForeRadius(), parent.getAftRadius()); mountBounds_m = new Rectangle2D.Double( xParent, yParent, parent.getLength(), rParent); - + + final double xMinBounds = Math.min(xParent, finBounds_m.getMinX()); + final double yMinBounds = Math.min(xParent, finBounds_m.getMinY()); final double subjectWidth = Math.max( xFinFront + finBounds_m.getWidth(), parent.getLength()); final double subjectHeight = Math.max( 2*rParent, rParent + finBounds_m.getHeight()); - subjectBounds_m = new Rectangle2D.Double( xParent, yParent, subjectWidth, subjectHeight); + subjectBounds_m = new Rectangle2D.Double( xMinBounds, yMinBounds, subjectWidth, subjectHeight); } @Override From fda3ae839f3625f0934f9f763b4f5ac3fd654585 Mon Sep 17 00:00:00 2001 From: Daniel_M_Williams Date: Sat, 1 Dec 2018 12:43:55 -0500 Subject: [PATCH 2/2] [fix #488] Dragging first fin point works correctly --- .../sf/openrocket/gui/configdialog/FreeformFinSetConfig.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/swing/src/net/sf/openrocket/gui/configdialog/FreeformFinSetConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/FreeformFinSetConfig.java index 893a9ceb6..dff8e0349 100644 --- a/swing/src/net/sf/openrocket/gui/configdialog/FreeformFinSetConfig.java +++ b/swing/src/net/sf/openrocket/gui/configdialog/FreeformFinSetConfig.java @@ -424,6 +424,10 @@ public class FreeformFinSetConfig extends FinSetConfig { Point2D.Double point = getCoordinates(event); finset.setPoint(dragIndex, point.x, point.y); + if(0 == dragIndex && 0 > point.x){ + dragIndex = 1; + } + updateFields(); }