private PointMagnet createPerpendicularMagnet(LineMagnet lm, GraphicView activeView, System.Windows.Forms.MouseEventArgs e)
{
if (lm == null) return null;
float lmDot = Vector3.Dot(lm.Direction, lm.Direction);
if (points.PrimaryPoint != null)
{
PointMagnet perp = addPerpendicularMagnet(lm, points.PrimaryPoint, lmDot, activeView, e);
if (perp != null) return perp;
}
if (points.LastPoint != null)
return addPerpendicularMagnet(lm, points.LastPoint, lmDot, activeView, e);
return null;
}