                 sizeLayoutElement(layoutElement, width, horizontalAlign, 
                                restrictedWidth, NaN, variableRowHeight, rh);
                 
-                spaceToDistribute -= layoutElement.getLayoutBoundsHeight();
+                spaceToDistribute -= Math.ceil(layoutElement.getLayoutBoundsHeight());
             } 
         }
         

                else
                    layoutElementWidth = layoutElement.getPreferredBoundsWidth();
                
                containerWidth = Math.max(containerWidth, layoutElementWidth);
            }
        }


                continue;
                
            // Set the layout element's position
            var dx:Number = Math.ceil(layoutElement.getLayoutBoundsWidth());
            var dy:Number = Math.ceil(layoutElement.getLayoutBoundsHeight());

            var x:Number = x0 + (containerWidth - dx) * hAlign;
            // In case we have HorizontalAlign.CENTER we have to round
            if (hAlign == 0.5)
                x = Math.round(x);
            layoutElement.setLayoutBoundsPosition(x, y);
                            
            // Update maxX,Y, first,lastVisibleIndex, and y
            maxX = Math.max(maxX, x + dx);
            maxY = Math.max(maxY, y + dy);
            if (!clipAndEnableScrolling ||
