Beispiel #1
0
        private void UpdateMarkers()
        {
            double x1 = Line.Start.X;
            double y1 = Line.Start.Y;
            double x2 = Line.End.X;
            double y2 = Line.End.Y;

            if (Style.Stroke.StartArrow.ArrowType != ArrowType.None)
            {
                double a1 = Math.Atan2(y1 - y2, x1 - x2);
                StartMarker = CreateArrowMarker(x1, y1, a1, Style, Style.Stroke.StartArrow);
                StartMarker.UpdateStyle();
                P0 = (StartMarker as MarkerBase).Point;
            }
            else
            {
                StartMarker = null;
                P0          = new SKPoint((float)x1, (float)y1);
            }

            if (Style.Stroke.EndArrow.ArrowType != ArrowType.None)
            {
                double a2 = Math.Atan2(y2 - y1, x2 - x1);
                EndMarker = CreateArrowMarker(x2, y2, a2, Style, Style.Stroke.EndArrow);
                EndMarker.UpdateStyle();
                P1 = (EndMarker as MarkerBase).Point;
            }
            else
            {
                EndMarker = null;
                P1        = new SKPoint((float)x2, (float)y2);
            }
        }
Beispiel #2
0
        private void UpdateMarkers()
        {
            double x1 = Line.Start.X;
            double y1 = Line.Start.Y;
            double x2 = Line.End.X;
            double y2 = Line.End.Y;

            Line.GetMaxLength(ref x1, ref y1, ref x2, ref y2);

            if (Style.StartArrowStyle.ArrowType != ArrowType.None)
            {
                double a1 = Math.Atan2(y1 - y2, x1 - x2);
                StartMarker = CreatArrowMarker(x1, y1, a1, Style.StartArrowStyle);
                StartMarker.UpdateStyle();
                P0 = (StartMarker as Marker).Point;
            }
            else
            {
                StartMarker = null;
                P0          = new A.Point(x1, y1);
            }

            if (Style.EndArrowStyle.ArrowType != ArrowType.None)
            {
                double a2 = Math.Atan2(y2 - y1, x2 - x1);
                EndMarker = CreatArrowMarker(x2, y2, a2, Style.EndArrowStyle);
                EndMarker.UpdateStyle();
                P1 = (EndMarker as Marker).Point;
            }
            else
            {
                EndMarker = null;
                P1        = new A.Point(x2, y2);
            }
        }
Beispiel #3
0
        public override void UpdateStyle()
        {
            base.UpdateStyle();

            if (Style.Stroke.StartArrow.ArrowType != ArrowType.None)
            {
                StartMarker?.UpdateStyle();
            }

            if (Style.Stroke.EndArrow.ArrowType != ArrowType.None)
            {
                EndMarker?.UpdateStyle();
            }
        }