Exemplo n.º 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;
        //    }
        //}

        private void RefreshLinkLayout()
        {
            if (_end1 == null || _end2 == null)
            {
                return;
            }

            double x1, y1, x2, y2;

            ShapeUtils.GetLinkPoints(_end1, _end2, out x1, out y1, out x2, out y2);
            line.X1 = x1;
            line.Y1 = y1;

            line.X2 = x2;
            line.Y2 = y2;
        }