                                                           maxWidth, maxHeight);
 
                 // If we fit the width, but not the height                                                          
-                if (actualSize && transformSize(actualSize, matrix).y > height)
+                if (actualSize && transformSize(actualSize.x, actualSize.y, matrix).y > height)
                 {
                     actualSize = calcUBoundsToFitTBoundsHeight(height, matrix,
                                                                preferredWidth, preferredHeight, 

	 *  <code>x + vec.x</code> and <code>y + vec.y</code> respectively
	 *  will offset the transformed bounds top left corner by x,y.
	 *
	 *  @return Returns the transformed bounds.
	 *  
	 *  @langversion 3.0
	 *  @playerversion Flash 9
	 *  @playerversion AIR 1.1
	 *  @productversion Flex 3
	 */
	public static function transformSize(bounds:Point, matrix:Matrix):Point
	{
		// FIXME (egeorgie): don't use new points, but do the math ourselves?
	    var pt1:Point = matrix.deltaTransformPoint(bounds);
	    var pt2:Point = matrix.deltaTransformPoint(new Point());
	    var pt3:Point = matrix.deltaTransformPoint(new Point(bounds.x, 0));
	    var pt4:Point = matrix.deltaTransformPoint(new Point(0, bounds.y));

        var maxX:Number = Math.max(Math.max(pt1.x, pt2.x), Math.max(pt3.x, pt4.x));
        var minX:Number = Math.min(Math.min(pt1.x, pt2.x), Math.min(pt3.x, pt4.x));
        var maxY:Number = Math.max(Math.max(pt1.y, pt2.y), Math.max(pt3.y, pt4.y));
        var minY:Number = Math.min(Math.min(pt1.y, pt2.y), Math.min(pt3.y, pt4.y));

	    pt1.x = maxX - minX;
	    pt1.y = maxY - minY;
	    return pt1;
	}

	/**
	 *  @param bounds width and height to be transformed.
	 *  @param matrix The transfomration matrix. 
	 *  
	 *  @param topleft If topLeft is non-null it will be used as the origin of the bounds
	 *  rectangle to be transformed.  On return, it will be set to the top left of the rectangle
	 *  after transformation.
	 *
	 *  @return Returns the transformed width and height
	 *  
	 *  @langversion 3.0
	 *  @playerversion Flash 9
	 *  @playerversion AIR 1.1
	 *  @productversion Flex 3
	 */
	public static function transformBounds(bounds:Point, matrix:Matrix, topLeft:Point = null):Point
	{
		// FIXME (egeorgie): don't use new points, but do the math ourselves?
		var x:Number = 0;
		var y:Number = 0;
		
		if (topLeft)
		{
			x = topLeft.x;
			y = topLeft.y;
		}	 
		
	    var pt1:Point = matrix.transformPoint(new Point(bounds.x + x, bounds.y + y));
	    var pt2:Point = matrix.transformPoint(new Point(x, y));
	    var pt3:Point = matrix.transformPoint(new Point(bounds.x + x, 0 + y));
	    var pt4:Point = matrix.transformPoint(new Point(0 + x, bounds.y + y));

	    var maxX:Number = Math.max(Math.max(pt1.x, pt2.x), Math.max(pt3.x, pt4.x));
	    var minX:Number = Math.min(Math.min(pt1.x, pt2.x), Math.min(pt3.x, pt4.x));
	    var maxY:Number = Math.max(Math.max(pt1.y, pt2.y), Math.max(pt3.y, pt4.y));
	    var minY:Number = Math.min(Math.min(pt1.y, pt2.y), Math.min(pt3.y, pt4.y));

	    if (topLeft )
	    {
	        topLeft.x = minX;
	        topLeft.y = minY;
		}

	    pt1.x = maxX - minX;
	    pt1.y = maxY - minY;
	    return pt1;
	}
	
	/**

                a * x + c1 * y < 0 ) // Satisfy Case2
            {
                // If there is no solution, or the new solution yields smaller value, pick the new solution.
                if (!s || transformSize(s.x, s.y, matrix).y > transformSize(x, y, matrix).y)
                   s = new Point(x, y);
            }
        }
