protected override void DrawTicks(
Graphics g,
Point physicalMin,
Point physicalMax,
out object labelOffset,
out object boundingBox)
{
Point tLabelOffset;
Rectangle tBoundingBox;
labelOffset = this.getDefaultLabelOffset( physicalMin, physicalMax );
boundingBox = null;
ArrayList largeTickPositions;
ArrayList smallTickPositions;
this.WorldTickPositions( physicalMin, physicalMax, out largeTickPositions, out smallTickPositions );
Point offset = new Point( 0, 0 );
object bb = null;
// Missed this protection
if (largeTickPositions.Count > 0)
{
for (int i=0; i<largeTickPositions.Count; ++i)
{
StringBuilder label = new StringBuilder();
// do google search for "format specifier writeline" for help on this.
label.AppendFormat(this.NumberFormat, (double)largeTickPositions[i]);
this.DrawTick( g, (double)largeTickPositions[i], this.LargeTickSize, label.ToString(),
new Point(0,0), physicalMin, physicalMax, out tLabelOffset, out tBoundingBox );
Axis.UpdateOffsetAndBounds( ref labelOffset, ref boundingBox, tLabelOffset, tBoundingBox );
}
}
else
{
// just get the axis bounding box)
PointF dir = Utils.UnitVector(physicalMin,physicalMax);
Rectangle rr = new Rectangle( physicalMin.X,
(int)((physicalMax.X-physicalMin.X)*dir.X),
physicalMin.Y,
(int)((physicalMax.Y-physicalMin.Y)*dir.Y) );
bb = rr;
}
// missed protection for zero ticks
if (smallTickPositions.Count > 0)
{
for (int i=0; i<smallTickPositions.Count; ++i)
{
this.DrawTick( g, (double)smallTickPositions[i], this.SmallTickSize,
"", new Point(0,0), physicalMin, physicalMax, out tLabelOffset, out tBoundingBox );
// ignore r for now - assume bb unchanged by small tick bounds.
}
}
}