             dx = 0;
         else if ((elementR.bottom >= scrollR.bottom) && (elementR.top <= scrollR.top))
             dy = 0;
+    
+        if (elementLocalBounds)
+        {
+            // Only adjust for local bounds if the element is wider than the scroll width
+            if ((elementR.left <= scrollR.left) && (elementR.right >= scrollR.right))
+            {
+                if (elementLocalBounds.left < scrollR.left)
+                    dx = elementLocalBounds.left - scrollR.left;
+                else if (elementLocalBounds.right > scrollR.right)
+                    dx = elementLocalBounds.right - scrollR.right;
+            }
+            
+            // Only adjust for local bounds if the element is taller than the scroll height
+            if ((elementR.bottom >= scrollR.bottom) && (elementR.top <= scrollR.top))
+            {
+                if (elementLocalBounds.bottom > scrollR.bottom) 
+                    dy = elementLocalBounds.bottom - scrollR.bottom;
+                else if (elementLocalBounds.top <= scrollR.top)
+                    dy = elementLocalBounds.top - scrollR.top;
+            }
+        }
         
         return new Point(dx, dy);
     }
     
-    mx_internal function getScrollPositionDeltaToAnyElement(element:IVisualElement, topOffset:Number = NaN, 
-                                                       bottomOffset:Number = NaN, 
-                                                       leftOffset:Number = NaN,
-                                                       rightOffset:Number = NaN):Point
+    /**
+     *  @private
+     */  
+    mx_internal function getScrollPositionDeltaToAnyElement(element:IVisualElement, 
+                                                            elementLocalBounds:Rectangle = null, 
+                                                            topOffset:Number = NaN,
+                                                            bottomOffset:Number = NaN,
+                                                            leftOffset:Number = NaN,
+                                                            rightOffset:Number = NaN):Point
     {
         
         var elementR:Rectangle = getChildElementBounds(element);
+        
+        if (elementLocalBounds)
+            elementLocalBounds = convertLocalToTarget(element, elementLocalBounds);
         return getScrollPositionDeltaToElementHelperHelper(
-            elementR, 
+            elementR, elementLocalBounds,
             topOffset, bottomOffset, 
             leftOffset, rightOffset);
         

        
        return new Rectangle(0,0,0,0);
    }
     
    /**
     *  @private

     *  @param leftOffset Number of pixels to position the element to the right of the left edge.
     *  @param rightOffset Number of pixels to position the element to the left of the right edge.
     */ 
    mx_internal function getScrollPositionDeltaToElementHelper(index:int, 
                                                               topOffset:Number = NaN, 
                                                               bottomOffset:Number = NaN, 
                                                               leftOffset:Number = NaN,
                                                               rightOffset:Number = NaN):Point
    {
        var elementR:Rectangle = getElementBounds(index);
        return getScrollPositionDeltaToElementHelperHelper(
                                                elementR, null,
                                                topOffset, bottomOffset, 
                                                leftOffset, rightOffset);
    }
