[#1420] Add clicked component check

This commit is contained in:
SiboVG 2022-06-09 19:05:27 +02:00
parent 910fd7c7cd
commit 49c641a71e

View File

@ -596,6 +596,8 @@ 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 the shift-button is held, add a newly clicked component to the selection path
if ((event.isShiftDown() || event.isMetaDown()) && event.getClickCount() == 1) {
List<TreePath> paths = new ArrayList<>(Arrays.asList(selectionModel.getSelectionPaths()));