Beispiel #1
0
        void RefreshContactSide(VdSegmentUtil.SegmentMarker side)
        {
            if (_end1 == null || _end2 == null)
            {
                return;
            }

            switch (side)
            {
            case VdSegmentUtil.SegmentMarker.Side1:
                double minDist;
                Point  minAnchorPt;
                ShapeUtils.NearestAnchor(new Point(line.X2, line.Y2),
                                         _end1,
                                         out anchor1,
                                         out minAnchorPt,
                                         out minDist);
                line.X1 = minAnchorPt.X;
                line.Y1 = minAnchorPt.Y;
                break;

            case VdSegmentUtil.SegmentMarker.Side2:
                ShapeUtils.NearestAnchor(new Point(line.X1, line.Y1),
                                         _end2,
                                         out anchor2,
                                         out minAnchorPt,
                                         out minDist);
                line.X2 = minAnchorPt.X;
                line.Y2 = minAnchorPt.Y;
                break;
            }
        }