SnappingAction

References
public class SnappingAction
A single resolved snapping action.

Constructors

SnappingAction

#
public SnappingAction(float dx, float dy, string text, PointF point, TextAnchor anchor, LineF[] lines)
Create a new snapping action. This is somewhat tricky, consider using one of the static creation methods.
dx (float)
dy (float)
text (string)
point (PointF)
anchor (TextAnchor)
lines (LineF[])

Properties

LabelAnchor

#
public TextAnchor LabelAnchor { get; }
Gets the text anchor for the label with respect to the point.

LabelPoint

#
public PointF LabelPoint { get; }
Gets the anchor point for the label text.

LabelText

#
public string LabelText { get; }
Gets the name of this action.

Lines

#
public LineF[] Lines { get; }
Gets all the lines that make up the snapping feedback graphics.

Magnitude

#
public float Magnitude { get; }
The sum of the absolute values of ΔX and ΔY.

ΔX

#
public float ΔX { get; }
Gets the motion in X required to make the snap happen.

ΔY

#
public float ΔY { get; }
Gets the motion in Y required to make the snap happen.

Methods

CreateBottomAlignAction

#
public static SnappingAction CreateBottomAlignAction(RectangleF source, RectangleF target, float dy)
Create a snapping action for bottom box alignment.
source (RectangleF)
target (RectangleF)
dy (float)

CreateCentreAlignAction

#
public static SnappingAction CreateCentreAlignAction(RectangleF source, RectangleF target, float dx)
Create a snapping action for horizontal centre box alignment.
source (RectangleF)
target (RectangleF)
dx (float)

CreateHorizontalGapActionAbove

#
public static SnappingAction CreateHorizontalGapActionAbove(RectangleF source, RectangleF target, int gapSize, float dx)
Create a snapping action for horizontal gap spacing with the feedback on top.
source (RectangleF)
target (RectangleF)
gapSize (int)
dx (float)

CreateHorizontalGapActionBelow

#
public static SnappingAction CreateHorizontalGapActionBelow(RectangleF source, RectangleF target, int gapSize, float dx)
Create a snapping action for horizontal gap spacing with the feedback underneath.
source (RectangleF)
target (RectangleF)
gapSize (int)
dx (float)

CreateLeftAlignAction

#
public static SnappingAction CreateLeftAlignAction(RectangleF source, RectangleF target, float dx)
Create a snapping action for left box alignment.
source (RectangleF)
target (RectangleF)
dx (float)

CreateRightAlignAction

#
public static SnappingAction CreateRightAlignAction(RectangleF source, RectangleF target, float dx)
Create a snapping action for right box alignment.
source (RectangleF)
target (RectangleF)
dx (float)

CreateStraightenWireAction

#
public static SnappingAction CreateStraightenWireAction(PointF source, PointF target)
Create a wire straightening action.
source (PointF)
target (PointF)

CreateTopAlignAction

#
public static SnappingAction CreateTopAlignAction(RectangleF source, RectangleF target, float dy)
Create a snapping action for left box alignment.
source (RectangleF)
target (RectangleF)
dy (float)

CreateVerticalGapActionOnLeft

#
public static SnappingAction CreateVerticalGapActionOnLeft(RectangleF source, RectangleF target, int gapSize, float dy)
Create a snapping action for vertical gap spacing with the label on the left.
source (RectangleF)
target (RectangleF)
gapSize (int)
dy (float)

CreateVerticalGapActionOnRight

#
public static SnappingAction CreateVerticalGapActionOnRight(RectangleF source, RectangleF target, int gapSize, float dy)
Create a snapping action for vertical gap spacing with the label on the right.
source (RectangleF)
target (RectangleF)
gapSize (int)
dy (float)

Draw

#
public void Draw(Context context, Color colour)
Draw this action in a graphics context.
context (Context)
colour (Color)

HorizontalOrthoAction

#
public static SnappingAction HorizontalOrthoAction(PointF origin, RectangleF frame)
Create a horizontal ortho constraint. This one has no deflection, but it does have feedback.
origin (PointF)
frame (RectangleF)

SmallerMagnitude

#
public static SnappingAction SmallerMagnitude(SnappingAction a, SnappingAction b)
Return the action with the smaller magnitude.
a (SnappingAction)
b (SnappingAction)

VerticalOrthoAction

#
public static SnappingAction VerticalOrthoAction(PointF origin, RectangleF frame)
Create a vertical ortho constraint. This one has no deflection, but it does have feedback.
origin (PointF)
frame (RectangleF)