public override void MoveToCore(Point newPosition) { ILinearFigure figure = LinearFigure; Parameter = figure.GetNearestParameterFromPoint(newPosition); newPosition = figure.GetPointFromParameter(Parameter); base.MoveToCore(newPosition); }
public static Point SnapPointToFigure(this ILinearFigure figure, Point point) { var parameter = figure.GetNearestParameterFromPoint(point); return(figure.GetPointFromParameter(parameter)); }