예제 #1
0
        public override void Render(IRenderContext rc)
        {
            if (rc == null)
            {
                throw new ArgumentNullException(nameof(rc));
            }

            if (!Areas.Any() || Areas.All(a => !a.Any()))
            {
                return;
            }

            VerifyAxes();

            OxyRect clippingRect = GetClippingRect();

            rc.SetClip(clippingRect);

            // Transform all points to screen coordinates
            foreach (IEnumerable <DataPoint> area in Areas)
            {
                int n0   = area.Count();
                var pts0 = new ScreenPoint[n0];
                TransformToScreenCoordinates(n0, pts0, area);

                rc.DrawClippedPolygon(clippingRect, pts0, 1, GetSelectableFillColor(Fill), Color, StrokeThickness);
            }

            rc.ResetClip();
        }