Пример #1
0
        protected override void UpdateScaleExtents(PaintArgs p)
        {
            Rectangle drawRectangle = p.DrawRectangle;
            Rectangle value         = new Rectangle(this.CenterPoint.X - this.HubRadius, this.CenterPoint.Y - this.HubRadius, 2 * this.HubRadius, 2 * this.HubRadius);

            this.m_DrawExtent.Reset();
            this.m_DrawExtent.Add(this.CenterPoint);
            this.m_DrawExtent.Add(value);
            for (int i = 0; i < base.TickList.Count; i++)
            {
                Point[] tickLine = this.GetTickLine(base.TickList[i] as IScaleTickBase);
                this.m_DrawExtent.Add(tickLine[0], tickLine[1]);
                if (base.TickList[i] is IScaleTickLabel)
                {
                    IScaleTickLabel scaleTickLabel = base.TickList[i] as IScaleTickLabel;
                    if (scaleTickLabel.TextVisible)
                    {
                        Rectangle textRect  = this.GetTextRect(p, scaleTickLabel);
                        double    textAngle = this.GetTextAngle(scaleTickLabel);
                        Point[]   array     = Math2.ToRotatedPoints(textAngle, textRect);
                        for (int j = 0; j < array.Length; j++)
                        {
                            this.m_DrawExtent.Add(array[j]);
                        }
                    }
                }
            }
            this.m_MaxRequiredWidth  = this.m_DrawExtent.MaxWidth + 4;
            this.m_MaxRequiredHeight = this.m_DrawExtent.MaxHeight + 4;
            this.CenterPoint         = this.m_DrawExtent.GetNewCenterPoint(this.CenterPoint, drawRectangle);
        }