                 // 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;
+                snapContentScrollPosition();
             }
             else
             {

                    position -= offset;
                else
                    position += viewportHeight - offset;
            }
        }
        

    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);
    }
    }
    
    /**
