dnd improvements

This commit is contained in:
Branislav Stojkovic
2019-02-03 09:58:19 +01:00
parent 91389ef09b
commit 6e9169242a
6 changed files with 74 additions and 61 deletions
@@ -1459,9 +1459,7 @@ public class Presenter implements IPlugInPort {
Point scaledPoint = scalePoint(point);
if (!dragInProgress) {
if (instantiationManager.getComponentSlot() != null)
addPendingComponentsToProject(scaledPoint, instantiationManager.getComponentTypeSlot(), null);
if (!dragInProgress && instantiationManager.getComponentSlot() == null) {
return;
}
@@ -1488,6 +1486,9 @@ public class Presenter implements IPlugInPort {
// selectedComponents);
// messageDispatcher.dispatchMessage(EventType.SELECTION_SIZE_CHANGED,
// calculateSelectionDimension());
} else if (instantiationManager.getComponentSlot() != null) {
preDragProject = currentProject.clone();
addPendingComponentsToProject(scaledPoint, instantiationManager.getComponentTypeSlot(), null);
} else {
updateSelection(selectedComponents);
}
@@ -2133,6 +2134,11 @@ public class Presenter implements IPlugInPort {
setNewComponentTypeSlot(null, null, false);
return;
}
if (componentType == null) {
controlPointMap.clear();
updateSelection(EMPTY_SELECTION);
}
// try to find a default template if none is provided
if (componentType != null && template == null) {