private PointMagnet createMidPoint(LineMagnet lm, GraphicView activeView, System.Windows.Forms.MouseEventArgs e)
{
if (lm == null) return null;
LineElement l;
if ((l = lm.Line) != null)
{
PointMagnet midPtMagnet = new PointMagnet(Vector3.Scale(l.I.Position + l.J.Position, 0.5f),
PointMagnetType.MidPoint);
if (midPtMagnet.Snap(activeView, e.Location) < SnapViewDistance)
{
midPtMagnet.RelatedMagnets.Add(lm);
points.Add(midPtMagnet);
return midPtMagnet;
}
}
return null;
}