 
 package flex.layout
 {
+import flash.geom.Rectangle;	
 
 import flex.core.Group;
 import flex.intf.ILayout;


    //--------------------------------------------------------------------------
    //
    //  Class constants
    //
    //--------------------------------------------------------------------------

    /**
	 *  @private
	 */
	private static const GAP:int = 6;
    
    //--------------------------------------------------------------------------
    //
    //  Class methods
    //
    //--------------------------------------------------------------------------


        var totalWidthToDistribute:Number = unscaledWidth;
        if (totalCount > 1)
            totalWidthToDistribute -= (totalCount - 1) * gap;

        distributeWidth(layoutItemArray, totalWidthToDistribute, unscaledHeight); 
                            
        // TODO EGeorgie: verticalAlign
        var vAlign:Number = 0;
        
        
        // If columnCount wasn't set, then as the LayoutItems are positioned
        // we'll count how many columns fall within the layoutTarget's scrollRect
        var visibleColumns:uint = 0;
        var minVisibleX:Number = layoutTarget.horizontalScrollPosition;
        var maxVisibleX:Number = minVisibleX + unscaledWidth
            
        // Finally, position the objects        
        var x:Number = 0;
        for each (var lo:ILayoutItem in layoutItemArray)
        {
            var y:Number = (unscaledHeight - lo.actualSize.y) * vAlign;
            lo.setActualPosition(x, y);
            if (!variableColumnWidth)
            	lo.setActualSize(columnWidth, lo.actualSize.y);
            var dx:Number = lo.actualSize.x;
            if((explicitColumnCount == -1) && (x < maxVisibleX) && ((x + dx) > minVisibleX))
            	visibleColumns += 1;
            x += dx + gap;
        }
        if (explicitColumnCount == -1) 
        	setColumnCount(visibleColumns);        

        var r:Rectangle = layoutTarget.scrollRect;
        if (r != null) 
        {
            r.width = unscaledWidth;
            r.height = unscaledHeight;
            layoutTarget.scrollRect = r;
        }
        else 
        {
        	var rx:Number = layoutTarget.horizontalScrollPosition;
        	var ry:Number = layoutTarget.verticalScrollPosition;
        	layoutTarget.scrollRect = new Rectangle(rx, ry, unscaledWidth, unscaledHeight);
        }
    }


    /**
     *  This function sets the width of each child
