[#1787] Deselect components when no components clicked

This commit is contained in:
SiboVG 2022-11-03 23:58:44 +01:00
parent d3e872478d
commit 6f6fc1dd23

View File

@ -609,7 +609,11 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
List<RocketComponent> selectedComponents = Arrays.stream(selectionModel.getSelectionPaths())
.map(c -> (RocketComponent) c.getLastPathComponent()).collect(Collectors.toList());
if (clicked == null || clicked.length == 0) return;
if (clicked == null || clicked.length == 0) {
selectionModel.setSelectionPaths(null);
ComponentConfigDialog.disposeDialog();
return;
}
// Check for double-click.
// If the shift/meta key is not pressed and the component was not already selected, ignore the double click and treat it as a single click