GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoLink Class / CalculateStroke Method
In This Topic
    CalculateStroke Method (GoLink)
    In This Topic
    This method is responsible for determining the points in the stroke, given the positions of the ports.
    Syntax
    public virtual void CalculateStroke()
    Remarks

    The standard stroke path is determined by properties of this link and of the two ports it is connected to. If both ports are GoPorts, by default this method considers the FromPort's GoPort.FromSpot and the ToPort's GoPort.ToSpot. If both spots are GoObject.NoSpot, this link's stroke will consist of two points determined by calling GoPort.GetFromLinkPoint and GoPort.GetToLinkPoint. (There are four points if the GoStroke.Style is GoStrokeStyle.Bezier--the points are plotted according to the value of GoStroke.Curviness.) If both spots have "spots" (i.e. not GoObject.NoSpot), there will be four points in the stroke, resulting in three straight line segments, unless Orthogonal is true, in which case there are six points (five horizontal or vertical line segments).

    However, if there are already more than the standard number of points in this link, the AdjustPoints method is called to give the link a chance to decide how it wants to modify its path. The behavior of AdjustPoints depends on the value of AdjustingStyle. If AdjustPoints returns false, this method plots the standard stroke as described above.

    If either port is not a GoPort, this stroke is just a single straight line segment between the centers of the objects. If either port is not a GoObject, this method does nothing.

    See Also