         else
         {
             if (!firstElement || !lastElement || 
-                (scrollR.top < firstElement.getLayoutBoundsY() && firstIndexInView != 0) || 
-                (scrollR.bottom >= (lastElement.getLayoutBoundsY() + lastElement.getLayoutBoundsHeight()) && lastIndexInView != n))
+                (y0 < firstElement.getLayoutBoundsY() && firstIndexInView != 0) || 
+                (y1 >= (lastElement.getLayoutBoundsY() + lastElement.getLayoutBoundsHeight()) && lastIndexInView != n))
             {
                 g.invalidateDisplayList();
             }

            return;    
        }
        
        var y0:Number = scrollR.top;
        var y1:Number = scrollR.bottom - .0001;
        if (y1 <= y0)
        {
            setIndexInView(-1, -1);

        // Start at the top index
        var iter:LayoutIterator = new LayoutIterator(target, itemIndex);
        
        if (numElements > 0)
        {
            do
            {
                element = iter.getCurrentElement();
                if (element && element.includeInLayout)
                {
                    numVisitedElements++;
                    
                    element.setLayoutBoundsSize(width, rowHeight);
                    element.setLayoutBoundsPosition(0, yPos);
                    
                    yPos += rowHeight;
                    
                    // If we are using virtual layout, only size and position 
                    // the visible elements
                    if (yPos > yPosMax && !foundLastVisibleElement)
                    {
                        foundLastVisibleElement = true;
                        // Keep track of the number of elements visible in the viewing area
                        numVisibleElements = numVisitedElements;
                        if (useVirtualLayout)
                            break;
                    }
                }
                
                // Make sure to not wrap if wrapElements = false
                if (!wrapElements && iter.currentIndex == numElements - 1)
                    break;
                
                iter.next();
            } 
            while (itemIndex != iter.currentIndex)
        }
        
        setRowCount(numVisibleElements);
        
        // Set the contentWidth and contentHeight
        target.setContentSize(target.width, Math.ceil(numElements * rowHeight));
    }
    
    override public function updateScrollRect(w:Number, h:Number):void
    {
        var g:GroupBase = target;
        if (!g)
            return;
        
        if (clipAndEnableScrolling)
        {
            var hsp:Number = horizontalScrollPosition;
            var vsp:Number = verticalScrollPosition;
            
            // If the verticalScrollPosition exceeds the max/min y value, then the
            // renderers will not be properly positioned. In which case,
            // we offset the y position of the renderers by the verticalScrollPosition
            if (((vsp + yOffset + g.getPreferredBoundsHeight()) > MAX_Y_VALUE) ||
                ((vsp + yOffset) < MIN_Y_VALUE))
                yOffset = -vsp;
            g.scrollRect = new Rectangle(hsp, vsp + yOffset, w, h);
        }
        else
            g.scrollRect = null;
    }

	override public function getElementBounds(index:int):Rectangle
