Merge pull request #489 from teyrana/fix_474_488

Fix 474, 488  (rendering and editing issues with free-form fins)
This commit is contained in:
Wes Cravens 2018-12-08 12:30:44 -06:00 committed by GitHub
commit ce2982e576
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -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();
}

View File

@ -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