From 3f0a5b1780a01ebc1c85818ecd60dff5cf77f036 Mon Sep 17 00:00:00 2001 From: Daniel_M_Williams Date: Sun, 10 May 2020 17:39:02 -0400 Subject: [PATCH] [fix] Fin tabs are now more resistant to non-physical / error states --- .../net/sf/openrocket/rocketcomponent/FinSet.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/FinSet.java b/core/src/net/sf/openrocket/rocketcomponent/FinSet.java index bb1f8f82a..ddc3f1ce5 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FinSet.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FinSet.java @@ -299,7 +299,7 @@ public abstract class FinSet extends ExternalComponent implements RingInstanceab /** * internally, set the internal offset and optionally validate tab * - * @param offsetRequest new requested shift of tab -- from + * @param offsetRequest new requested tob offset */ public void setTabOffset( final double offsetRequest) { tabOffset = offsetRequest; @@ -345,14 +345,19 @@ public abstract class FinSet extends ExternalComponent implements RingInstanceab //check front bounds: if( tabPosition < 0){ this.tabPosition = 0; - } - + } + //check tail bounds: - final double xTabBack = getTabTrailingEdge(); + if (this.length < tabPosition ) { + this.tabPosition = length; + } + final double xTabBack = getTabTrailingEdge(); if( this.length < xTabBack ){ this.tabLength -= (xTabBack - this.length); } - + + tabLength = Math.max(0, tabLength); + // check tab height if( null != getParent() ){ // pulls the parent-body radius at the fin-tab reference point.