-
Notifications
You must be signed in to change notification settings - Fork 11
setRoutingCheckpoints() does not mark connector as needing rerouting #34
Copy link
Copy link
Closed
Description
Description:
When calling connRef.setRoutingCheckpoints() followed by router.processTransaction(), the connector's route is not recalculated. It appears that setRoutingCheckpoints() does not mark the connector as dirty/needing rerouting
internally.
Steps to reproduce:
- Create a router, two shapes, and a connector between them
- Call
router.processTransaction()— route is calculated correctly - Create a CheckpointVector, add a Checkpoint, and call
connRef.setRoutingCheckpoints(checkpointVector) - Call
router.processTransaction() - Observe that
connRef.displayRoute()returns the same route as before — the checkpoint is ignored
Expected behavior:
After calling setRoutingCheckpoints() and processTransaction(), the connector should be rerouted through the specified checkpoints.
Workaround:
Re-setting the source and/or destination endpoints (via connRef.setSourceEndpoint() / connRef.setDestEndpoint()) before calling processTransaction() forces libavoid to mark the connector as needing rerouting. The checkpoints are then
correctly taken into account.
// This does NOT trigger rerouting:
connRef.setRoutingCheckpoints(checkpointVector);
router.processTransaction(); // route unchanged
// This DOES work:
connRef.setSourceEndpoint(sourceConnEnd); // forces dirty flag
connRef.setDestEndpoint(targetConnEnd);
connRef.setRoutingCheckpoints(checkpointVector);
router.processTransaction(); // route now goes through checkpointsVersion
libavoid-js 0.5.0-beta.3
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels