                     position -= offset;
                 else
                     position += viewportWidth - offset;
+                
+                // Clip the position to the valid min/max range
+                position = Math.min(Math.max(minHorizontalScrollPosition, position), maxHorizontalScrollPosition);
             }
             else if (canScrollVertically && propertyName == VERTICAL_SCROLL_POSITION && viewportHeight != 0)
             {

                // require changing directions relative to the current throw,
                // which looks strange.
                throwEffect.stop();
                if (viewport.verticalScrollPosition > maxVerticalScrollPosition)
                    viewport.verticalScrollPosition = maxVerticalScrollPosition;
                if (viewport.horizontalScrollPosition > maxHorizontalScrollPosition)
                    viewport.horizontalScrollPosition = maxHorizontalScrollPosition;
            }
            else
            {

    private function snapContentScrollPosition(snapHorizontal:Boolean = true, snapVertical:Boolean = true):void
    {
        if (snapHorizontal)
    {
        viewport.horizontalScrollPosition = getSnappedPosition( 
            Math.min(Math.max(minHorizontalScrollPosition, viewport.horizontalScrollPosition), maxHorizontalScrollPosition),
            HORIZONTAL_SCROLL_POSITION);
        }

        if (snapVertical)
        {
        viewport.verticalScrollPosition = getSnappedPosition( 
            Math.min(Math.max(minVerticalScrollPosition, viewport.verticalScrollPosition), maxVerticalScrollPosition),
            VERTICAL_SCROLL_POSITION);
    }
    }
    
    /**
