         var minVisibleY:Number = layoutTarget.verticalScrollPosition;
         var maxVisibleY:Number = minVisibleY + unscaledHeight;
         
-        // Finally, position the objects        
+        // Finally, position the LayoutItems and find the first/last
+        // visible indices, the content size, and the number of 
+        // visible items.    
         var y:Number = 0;
         var maxX:Number = 0;
         var maxY:Number = 0;
-        for each (var lo:ILayoutItem in layoutItemArray)
-        {
+        var firstRowInView:int = -1;
+        var lastRowInView:int = -1;
+        
+        for (var index:int = 0; index < count; index++)
+        {
+            var lo:ILayoutItem = layoutTarget.getLayoutItemAt(index);
+            if (!layoutItem || !layoutItem.includeInLayout)
+                continue;
+
+        	// Set the layout item's acutual size and position
             var x:Number = (unscaledWidth - lo.actualSize.x) * hAlign;
             lo.setActualPosition(x, y);
             var dx:Number = lo.actualSize.x;
             if (!variableRowHeight)
                 lo.setActualSize(dx, rowHeight);
+                
+            // Update maxX,Y, first,lastVisibleIndex, and y
             var dy:Number = lo.actualSize.y;
             maxX = Math.max(maxX, x + dx);
             maxY = Math.max(maxY, y + dy);
             if ((y < maxVisibleY) && ((y + dy) > minVisibleY))
+            {
             	visibleRows += 1;
+            	if (firstRowInView == -1)
+            	   firstRowInView = lastRowInView = index;
+            	else
+            	   lastRowInView = index;
+            }
             y += dy + gap;
         }
+        
         setRowCount(visibleRows);
+        setIndexInView(firstRowInView, lastRowInView);
         layoutTarget.setContentSize(maxX, maxY);
     }
     

    //----------------------------------
    //  gap
    //----------------------------------
    private function invalidateTargetSizeAndDisplayList():void
    {
        var layoutTarget:GroupBase = target;

package flex.layout
{
import flash.geom.Rectangle;
import flash.display.DisplayObject;
import flash.events.Event;
import flash.events.EventDispatcher;

import flex.core.GroupBase;
import flex.graphics.IGraphicElement;
import flex.intf.ILayout;
import flex.intf.ILayoutItem;

import mx.containers.utilityClasses.Flex;
import mx.events.PropertyChangeEvent;
import flex.core.Group;


/**
