Merge pull request #1788 from SiboVG/issue-1787

[#1787] Deselect components when no components clicked
This commit is contained in:
Sibo Van Gool 2022-11-04 21:43:26 +01:00 committed by GitHub
commit 44ee427c19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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