Пример #1
0
 internal override bool hitTest(PointF p)
 {
     for (int i = 0; i < shapeSegments.Count; ++i)
     {
         Segment s1 = (Segment)shapeSegments[i];
         Segment s2 = (Segment)shapeSegments[(i + 1) % shapeSegments.Count];
         if (s1.hitTest(p))
         {
             if (!s1.checkCommonPointStart() && !s1.checkCommonPointEnd() && showPoints)
             {
                 currSegment   = s1;
                 belongSegment = null;
                 return(true);
             }
             else
             if (s1.checkCommonPointEnd() && s2.hitTest(p) && showPoints)
             {
                 currSegment   = s1;
                 belongSegment = s2;
                 return(true);
             }
         }
     }
     return(false);
 }
Пример #2
0
// end Constructor

        internal override bool hitTest(PointF p)
        {
            if (!base.hitTest(p))
            {
                BelongSegment = null;
                Segment s1 = (Segment)shapeSegments[0];
                Segment s2 = (Segment)shapeSegments[shapeSegments.Count - 1];
                if (s1.hitTest(p) && s1.checkCommonPointStart())
                {
                    currSegment = s1;
                    return(true);
                }
                if (s2.hitTest(p) && s2.checkCommonPointEnd())
                {
                    currSegment = s2;
                    return(true);
                }

                return(false);
            }
            return(true);
        }