From d5420820fa0e7812a40a2603dbff27d32b09fc0b Mon Sep 17 00:00:00 2001 From: SiboVG Date: Wed, 1 Jun 2022 20:17:21 +0200 Subject: [PATCH] Scale entire rocket when rocket or stage selected --- .../net/sf/openrocket/gui/dialogs/ScaleDialog.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/swing/src/net/sf/openrocket/gui/dialogs/ScaleDialog.java b/swing/src/net/sf/openrocket/gui/dialogs/ScaleDialog.java index 235ad81a6..df7a0717d 100644 --- a/swing/src/net/sf/openrocket/gui/dialogs/ScaleDialog.java +++ b/swing/src/net/sf/openrocket/gui/dialogs/ScaleDialog.java @@ -347,7 +347,16 @@ public class ScaleDialog extends JDialog { // Select the 'scale component / scale selection and all subcomponents' if a component is selected if (selection != null && selection.size() > 0) { - selectionOption.setSelectedIndex(1); + boolean entireRocket = false; // Flag to scale entire rocket + for (RocketComponent component : selection) { + if (component instanceof Rocket || (component instanceof AxialStage && !(component instanceof ParallelStage))) { + entireRocket = true; + break; + } + } + if (!entireRocket) { + selectionOption.setSelectedIndex(1); + } } // Change the offset checkbox to false when 'Scale selection' is selection and only one component is selected,