         if (llv.minorSize != contentWidth)
         {
             contentWidth = llv.minorSize;
+            containerWidth = Math.max(contentWidth, targetWidth);            
             if ((horizontalAlign != HorizontalAlign.LEFT) && (horizontalAlign != HorizontalAlign.JUSTIFY))
             {
                 for (index = startIndex; index <= endIndex; index++)
                 {
                     elt = layoutTarget.getLayoutElementAt(index);
                     w = calculateElementWidth(elt, targetWidth, contentWidth);
-                    x = calculateElementX(elt, w, contentWidth);
+                    x = calculateElementX(elt, w, containerWidth);
                     elt.setLayoutBoundsPosition(x, elt.getLayoutBoundsY());
                     elt.setLayoutBoundsSize(w, elt.getLayoutBoundsHeight());         
                 }

     *  following is true:
     * 
     *  - If horizontalAlign is "center" then x is set so that the element's preferred
     *  width is centered within the contentWidth:
     *      x = (contentWidth - layoutElementWidth) * 0.5
     * 
     *  - If horizontalAlign is "right" the x is set so that the element's right
     *  edge is aligned with the the right edge of the content:
     *      x = (contentWidth - layoutElementWidth)
     * 
     *  Implementation note: unless horizontalAlign is either "justify" or 
     *  "left", the layout elements' x or width depends on the contentWidth.

                continue;
                
            // Set the layout element's position
            var x:Number = (containerWidth - layoutElement.getLayoutBoundsWidth()) * hAlign;
            layoutElement.setLayoutBoundsPosition(x, y);
                            
            // Update maxX,Y, first,lastVisibleIndex, and y
