Skip to content

setRoutingCheckpoints() does not mark connector as needing rerouting #34

@kumilingus

Description

@kumilingus

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:

  1. Create a router, two shapes, and a connector between them
  2. Call router.processTransaction() — route is calculated correctly
  3. Create a CheckpointVector, add a Checkpoint, and call connRef.setRoutingCheckpoints(checkpointVector)
  4. Call router.processTransaction()
  5. 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 checkpoints

Version

libavoid-js 0.5.0-beta.3

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions