GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoGrid Class / FindNearestGridPoint Method
A PointF in document coordinates.
the object being dragged if SnapDragWhole is true; may be null/nothing
In This Topic
    FindNearestGridPoint Method (GoGrid)
    In This Topic
    Find the nearest grid point to a given point.
    Syntax
    public virtual PointF FindNearestGridPoint( 
       PointF p,
       GoObject obj
    )

    Parameters

    p
    A PointF in document coordinates.
    obj
    the object being dragged if SnapDragWhole is true; may be null/nothing

    Return Value

    A PointF point in document coordinates, adjusted according to value of SnapCellSpot. When obj is not null, the returned point is also adjusted to try to include the whole object within the grid. If that object cannot fit in the grid because it is too wide and/or too tall, the GoObject.Location of the object, if along one of the four edges of the object, determines which side(s) stay within the bounds of the grid.
    See Also