Hi Steffen,
Quote:1) Depending on the size of the offset, determined by our UX designer, placing the anchor points at that offset, there might be a visible gap between the boundaries and the anchor points, which might cause confusion for the user.
To me it sounds more confusing to show links connected to a different position than one indicated by anchor point marks
but if you need visual offset too you should be able to custom-draw it from DrawAnchorPoint event handler.
Quote:I am a bit surprised that a ConnectionPoint-derived class should not be able to solve this. According to the documentation I got the impression that this was right in its playing field. Also, with our current code, it works very nicely, except for that initial positioning being wrong, and which snaps into place as soon as the user moves or rotates the node.
At this time ConnectionPoint is used to abstract links from node types and their child items (e.g. table rows), but not from node's AnchorPattern. Alignment to anchor points is handled by nodes themselves, so you can't override it via custom ConnectionPoint class. We could probably move the alignment logic to ConnectionPoint too for next release if you prefer applying offsets there instead of moving the anchor points.
Quote:The fixed anchor point coordinates sounds interesting. Is it possible to dynamically update these coordinates on node re-sizing? And will connected links adjust themselves to the updated coordinates?
It seems possible via NodeModifying event handler:
private void diagram_NodeModifying(object sender, NodeValidationEventArgs e)
{
var pattern = e.Node.AnchorPattern;
if (pattern != null)
{
foreach (var ap in pattern.Points)
if ("right".Equals(ap.Tag))
ap.X = e.Node.Bounds.Width + 10;
}
}
private void diagram_NodeCreated(object sender, NodeEventArgs e)
{
e.Node.AnchorPattern = new AnchorPattern(new[]
{
new AnchorPoint(e.Node.Bounds.Width + 10, 10) { Tag = "right", XUnit = UnitType.Fixed }
});
}
Having Fixed-unit coordinates relative to right or bottom node sides looks useful, we'll implement some out-of-the-box support for them for next release.
I hope that helps,
Stoyan