Hi,
I try to snap to the nearest point when creating a shape. The method bellow works but only for the first point of the shape. Then the method is still fired and TargetPointShape and AddingVerted are set but in the end the point is not snapped. Did I miss something here ?
private void TrackOverlay_VertexAdding(object sender, VertexAddingTrackInteractiveOverlayEventArgs e)
{
PointShape targetPointShape = new(e.AddingVertex.X, e.AddingVertex.Y);
PointShape nearPS = FindNearestSnappingPoint(targetPointShape);
if (nearPS != null)
{
e.AddingVertex = new Vertex(nearPS.X, nearPS.Y);
e.TargetPointShape = nearPS;
}
}