Skip to content
Snippets Groups Projects
Commit 671705a8 authored by Ulrich Schöpp's avatar Ulrich Schöpp
Browse files

Make default link controller pass actual start location, not null

The default link controller in ControllerBase would invoke link
with argument startLocation being null rather than the start location.

Issue-Ref: 3924
Issue-Url: https://af3-developer.fortiss.org/issues/3924


Signed-off-by: default avatarUlrich Schöpp <schoepp@fortiss.org>
parent 941c78d4
No related branches found
No related tags found
1 merge request!89[3924] Fix small bugs in fx diagram editor
AnchorageContentControllerBase.java da56b10cbf2711b5da69f0b59f43eacbe54f4eea YELLOW
ClickControllerBase.java 8e5861ed5f9318008ad0fdd5497ed320cd5bd647 YELLOW
ContentAnchorageMoveControllerBase.java c18e7915ce23e124757f5b736086ecc46694800a YELLOW
ControllerBase.java 309e9ee3f3a255b5a06fed8f1b4d4ec8bf88f101 YELLOW
ControllerBase.java 6f32c252fad45327c5ece55ec81f517421d2d4a6 YELLOW
DefaultDiagramController.java 0e083b89a08f63967102a384d66ebc1d64d203af YELLOW
DelegatingContentAnchorageController.java 2e3b1b4e14402a3503233f816b21ef3e4aa09edc YELLOW
DragControllerBase.java b15ff874304f679fe494d85f57cc8cbe4d0d1d15 YELLOW
......
......@@ -147,7 +147,13 @@ public abstract class ControllerBase extends MVCBundlePartBase implements IContr
IMVCBundle startBundle = getMVCBundle();
getViewer().terminateNewLinkLineFeedback();
if(canLink(startBundle, startDiagramLocation, endBundle, endDiagramLocation)) {
return () -> link(startBundle, startDiagramLocation, endBundle, endDiagramLocation);
// Need to copy the location to a local variable to make sure that it is passed
// by value to the returned closure. Otherwise the closure will capture 'this' and
// link will see a future value of startDiagramLocation, likely null because
// startDiagramLocation is being set to null right after this return.
final DiagramCoordinate startDiagramLocation_ = startDiagramLocation;
return () -> link(startBundle, startDiagramLocation_, endBundle,
endDiagramLocation);
}
return null;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment