             return index + Math.floor(Number(distance - curDistance) / Number(_defaultMajorSize + _gap));
         }
     }
-        
+
     /**
      *  Stores the <code>majorSize</code> for the specified ILayoutElement at index, 
      *  and updates the <code>minorSize</code> and <code>minMinorSize</code> properties.

package spark.layouts.supportClasses
{
import flash.geom.Rectangle;
import spark.primitives.Rect;
import mx.core.ILayoutElement;
import mx.resources.IResourceManager;
import mx.resources.ResourceManager;

        if (!elt || (index >= _length))
            return;
            
        // The minorSize is the min of the acutal width and the preferred width
        // because we do not want the contentWidth to track the target's width, 
        // per horizontalAlign="contentJustify" or "justify".  
        // The majorAxis=HORIZONTAL case is similar.
        
        if (majorAxis == VERTICAL)
        {
            setMajorSize(index, elt.getLayoutBoundsHeight());
            var w:Number = Math.min(elt.getPreferredBoundsWidth(), elt.getLayoutBoundsWidth());
            minorSize = Math.max(minorSize, w);
            minMinorSize = Math.max(minMinorSize, elt.getMinBoundsWidth());
        }
        else
        {
            setMajorSize(index, elt.getLayoutBoundsWidth());            
            var h:Number = Math.min(elt.getPreferredBoundsHeight(), elt.getLayoutBoundsHeight());
            minorSize = Math.max(minorSize, h);
            minMinorSize = Math.max(minMinorSize, elt.getMinBoundsHeight());
        }
