mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-07 12:24:58 +10:00
Using "Duplicate Selection" results in duplicates of component ids, breaking Project Explorer panel and causing other issues downstream
This commit is contained in:
@@ -276,7 +276,7 @@ public class InstantiationManager {
|
||||
private List<IDIYComponent<?>> instantiateComponent(ComponentType componentType, Point2D point,
|
||||
Project currentProject) throws InstantiationException, IllegalAccessException, NoSuchMethodException,
|
||||
SecurityException, IllegalArgumentException, InvocationTargetException {
|
||||
LOG.info("Instatiating component of type: " + componentType.getInstanceClass().getName());
|
||||
LOG.info("Instantiating component of type: " + componentType.getInstanceClass().getName());
|
||||
|
||||
// Instantiate the component.
|
||||
IDIYComponent<?> component;
|
||||
|
||||
@@ -1664,6 +1664,7 @@ public class Presenter implements IPlugInPort {
|
||||
ComponentProcessor.getInstance().extractComponentTypeFrom(
|
||||
(Class<? extends IDIYComponent<?>>) cloned.getClass());
|
||||
cloned.setName(instantiationManager.createUniqueName(componentType, currentProject.getComponents()));
|
||||
cloned.setId(UUID.randomUUID());
|
||||
newSelection.add(cloned);
|
||||
for (int i = 0; i < component.getControlPointCount(); i++) {
|
||||
Point2D p = component.getControlPoint(i);
|
||||
|
||||
Reference in New Issue
Block a user