コード例 #1
0
        private void TruncateIntervalDrawTicGrid(Graphics g,
                                                 GraphPane pane,
                                                 float topPix,
                                                 MinorTic tic,
                                                 MinorGrid grid,
                                                 bool drawGrid,
                                                 float shift,
                                                 float scaleFactor,
                                                 float scaledTic,
                                                 ref double dStartInterval,
                                                 ref double dEndInterval,
                                                 out float pStartInterval,
                                                 out float pEndInterval,
                                                 out float pIntervalWidth)
        {
            bool movedStart = false;
            bool movedEnd   = false;

            if (dStartInterval < _minLinTemp)
            {
                dStartInterval = _minLinTemp;
                movedStart     = true;
            }

            if (dEndInterval > _maxLinTemp)
            {
                dEndInterval = _maxLinTemp;
                movedEnd     = true;
            }
            pStartInterval = LocalTransform(dStartInterval);
            pEndInterval   = LocalTransform(dEndInterval);
            pIntervalWidth = pEndInterval - pStartInterval;
            if (pIntervalWidth > 0)
            {
                Pen lPen;
                if (drawGrid)
                {
                    lPen = grid.GetPen(pane, scaleFactor);
                }
                else
                {
                    lPen = tic.GetPen(pane, scaleFactor);
                }

                if (!movedStart)
                {
                    if (drawGrid)
                    {
                        grid.Draw(g, lPen, pStartInterval, topPix);
                    }
                    else
                    {
                        tic.Draw(g, pane, lPen, pStartInterval, topPix, shift, scaledTic);
                    }
                }
                if (!movedEnd && pIntervalWidth > 2)
                {
                    if (drawGrid)
                    {
                        grid.Draw(g, lPen, pEndInterval, topPix);
                    }
                    else
                    {
                        tic.Draw(g, pane, lPen, pEndInterval, topPix, shift, scaledTic);
                    }
                }
            }
        }