예제 #1
0
        public static void DrawMarker(Graphics gfx, PointF pixelLocation, IMarker marker, float size, Brush brush, Pen pen)
        {
            if (size == 0)
            {
                return;
            }

            float diameter = size;
            float radius   = diameter / 2;

            /* Improve marker vs. line alignment on Linux and MacOS
             * https://github.com/ScottPlot/ScottPlot/issues/340
             * https://github.com/ScottPlot/ScottPlot/pull/1660
             */
            if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                pixelLocation = new PointF(pixelLocation.X + .5f, pixelLocation.Y);
            }

            marker.Draw(gfx, pixelLocation, radius, brush, pen);
        }