SnapLine

SnapElement
public sealed class SnapLine : SnapElement
Represents a single snapping line in a graphics context.

Constructors

SnapLine

#
public SnapLine(double value, bool isVertical, float range0, float range1, float domain0, float domain1)
Create a new snap line.
value (double)Value of snap line.
isVertical (bool)Direction of line.
range0 (float)Visual range start.
range1 (float)Visual range end.
domain0 (float)Line length lower limit.
domain1 (float)Line length upper limit.

Properties

Centre

#
public float Centre { get; }
Gets the centre of the domain.

Domain0

#
public float Domain0 { get; }
Gets the lower domain of the line. If this property returns float.NegativeInfinity or float.MinValue, the line is considered to not be limited at this end.

Domain1

#
public float Domain1 { get; }
Gets the upper domain of the line. If this property returns float.PositiveInfinity or float.MaxValue, the line is considered to not be limited at this end.

IsHorizontal

#
public bool IsHorizontal { get; }
Gets whether this snapping line is horizontal.

IsLimitedDomain

#
public bool IsLimitedDomain { get; }
Gets whether this line has a limited domain.

IsVertical

#
public bool IsVertical { get; }
Gets whether this snapping line is vertical.

Range

public float Range { get; }
Gets the radius of influence of this snap element. This value is used for sorting, in that elements with bigger ranges are sorted earlier.
inherited fromSnapElement
Range

Range0

#
public float Range0 { get; }
Gets the beginning of the snapping domain in graphics coordinates.

Range1

#
public float Range1 { get; }
Gets the end of the snapping domain in graphics coordinates.

Value

#
public double Value { get; }
Gets the value for this snapping line.

Methods

CompareTo

public int CompareTo(ISnapElement other)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
inherited fromSnapElement
other (ISnapElement)An object to compare with this instance.
A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes other in the sort order. Zero This instance occurs in the same position in the sort order as other. Greater than zero This instance follows other in the sort order.

Snap

#
public override bool Snap(double x, double y, out double snapX, out double snapY)
Snap a point to this element.
x (double)Point x coordinate to snap.
y (double)Point y coordinate to snap.
snapX (out double)Snapped x coordinate.
snapY (out double)snapped y coordinate.
True if (x, y) got mapped to a different (x', y').
SnapElement.Snap