I think I may have managed to fix the problem. Actually it's not related to the fixed point story specifically. The hand drawn connection is failing for all shapes with special perimeter. While investigating the issue, I came accross a mxGraph migration guide that talked about the "entryperimeter"/"exitperimeter" properties used when defining the style of edges when creating new ones via insertEdge for instance. It said that these properties had their type changed from 0 and 1 values (representing booleans) to actual booleans. Lo and behold what I found in the ConnectionMixin :
|
// Only writes 0 since 1 is default |
|
if (!constraint.perimeter) { |
|
this.setCellStyles(source ? 'exitPerimeter' : 'entryPerimeter', '0', [edge]); |
|
} else { |
|
this.setCellStyles(source ? 'exitPerimeter' : 'entryPerimeter', null, [edge]); |
|
} |
The second argument of setCellStyles is supposed to be a boolean, but it's still attributed '0' or null. This is in the setConnectionContraint method of the mixin for the connection handler. I believe what's happening is that the connection handler silently drops the CellStateStyle linked to the projection of connection points on the perimeter.
By replacing these lines with
// Only writes 0 since 1 is default
if (!constraint.perimeter) {
this.setCellStyles(source ? 'exitPerimeter' : 'entryPerimeter', false, [edge]);
} else {
this.setCellStyles(source ? 'exitPerimeter' : 'entryPerimeter', true, [edge]);
}
Connection connect precisely to the point on the perimeter of edges which have either entry or exit perimeter set to true. The problem was only present on manual connections, since the Fixed Points story correctly declares them as boolean when programmatically creating new edges.
I feel like type assertions are stiffled by the structure of setCellStyle.