internal GraphicsPath MakePath(PaneBase pane)
        {
            GraphicsPath path   = new GraphicsPath();
            bool         first  = true;
            PointF       lastPt = new PointF();

            foreach (PointD pt in _points)
            {
                // Convert the coordinates from the user coordinate system
                // to the screen coordinate system
                // Offset the points by the location value
                PointF pixPt = Location.Transform(pane, pt.X + _location.X, pt.Y + _location.Y,
                                                  _location.CoordinateFrame);

                if (Math.Abs(pixPt.X) < 100000 &&
                    Math.Abs(pixPt.Y) < 100000)
                {
                    if (first)
                    {
                        first = false;
                    }
                    else
                    {
                        path.AddLine(lastPt, pixPt);
                    }

                    lastPt = pixPt;
                }
            }

            path.CloseFigure();

            return(path);
        }
Beispiel #2
0
        internal GraphicsPath MakePath(PaneBase pane)
        {
            var path   = new GraphicsPath();
            var first  = true;
            var lastPt = new PointF();

            foreach (var pt in _points)
            {
                // Convert the coordinates from the user coordinate system
                // to the screen coordinate system
                // Offset the points by the location value
                var pixPt = Location.Transform(
                    pane,
                    pt.X + _location.X,
                    pt.Y + _location.Y,
                    _location.CoordinateFrame);

                if (Math.Abs(pixPt.X) >= 100000 || Math.Abs(pixPt.Y) >= 100000)
                {
                    continue;
                }
                if (first)
                {
                    first = false;
                }
                else
                {
                    path.AddLine(lastPt, pixPt);
                }

                lastPt = pixPt;
            }

            if (_isClosedFigure)
            {
                path.CloseFigure();
            }

            return(path);
        }