[#1523] Fix copy component order

This commit is contained in:
SiboVG 2022-08-14 19:34:57 +02:00
parent 31139bbab2
commit 7bb0363e8b

View File

@ -659,6 +659,7 @@ public class RocketActions {
}
List<RocketComponent> copiedComponents = new LinkedList<>(copyComponentsMaintainParent(components));
copiedComponents.sort(Comparator.comparing(c -> c.getParent() != null ? -c.getParent().getChildPosition(c) : 0));
OpenRocketClipboard.setClipboard(copiedComponents);
delete(components);
@ -717,6 +718,7 @@ public class RocketActions {
if (isCopyable(components)) {
List<RocketComponent> copiedComponents = new LinkedList<>(copyComponentsMaintainParent(components));
copiedComponents.sort(Comparator.comparing(c -> c.getParent() != null ? -c.getParent().getChildPosition(c) : 0));
OpenRocketClipboard.setClipboard(copiedComponents);
parentFrame.selectTab(BasicFrame.COMPONENT_TAB);