 ////////////////////////////////////////////////////////////////////////////////
 //
 //  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2010 Adobe Systems Incorporated
+//  Copyright 2011 Adobe Systems Incorporated
 //  All Rights Reserved.
 //
 //  NOTICE: Adobe permits you to use, modify, and distribute this file

        if (diameter % 2 != 0)
            diameter--;
        
        diameter = spinnerDiameterFixup(diameter);
        
        return diameter;
    }
    
    /**
     *  @private
     * 
     *  Modify the spinnerDiameter to avoid diameters that end up causing the 
     *  spinner to jitter. This will cause us to reuse the spokeWidth and 
     *  spokeHeight of the previous diameter size.
     */ 
    private function spinnerDiameterFixup(diameter:Number):Number
    {
        if (applicationDPI == DPIClassification.DPI_240)
        {
            // For diameter 30, use the settings for diameter 28 (29 is the same)
            if (diameter >= 30 && diameter <= 33)
                diameter = 28;
        }
        else if (applicationDPI == DPIClassification.DPI_160)
        {
            if (diameter == 24)
                diameter = 22;
            else if (diameter == 28)
                diameter = 26;
        }
        
        return diameter;
    }
    

        var insidePoint:Point = new Point();
        
        g.lineStyle(spokeWidth, spokeColor, spokeAlpha, false, LineScaleMode.NORMAL, CapsStyle.ROUND);
        outsidePoint = calculatePointOnCircle(spinnerRadius, spinnerRadius - eHeight - spinnerPadding, degrees);
        insidePoint = calculatePointOnCircle(spinnerRadius, spinnerRadius - spokeHeight + eHeight - spinnerPadding, degrees);
        g.moveTo(outsidePoint.x, outsidePoint.y);
        g.lineTo(insidePoint.x,  insidePoint.y);
            
