Skip to content
  • jberlin@apple.com's avatar
    Index: WebCore/ChangeLog · 50b7aa71
    jberlin@apple.com authored
    ===================================================================
    --- WebCore/ChangeLog	(revision 44622)
    +++ WebCore/ChangeLog	(working copy)
    @@ -1,3 +1,23 @@
    +2009-06-12  Jessie Berlin  <jberlin@apple.com>
    +
    +        Reviewed by Mark Rowe.
    +
    +        https://bugs.webkit.org/show_bug.cgi?id=24792
    +        rdar://problem/6933055
    +
    +        Changes the radius in which cursor movement around the 4 arrow icon
    +        while pan-scrolling does not cause scrolling from around 10 pixels to
    +        15 pixels, similar to what is found in IE and Firefox.
    +
    +        * page/EventHandler.cpp:
    +        (WebCore::EventHandler::setPanScrollCursor):
    +        Factor out the no-pan-scroll radius.
    +        * platform/ScrollView.h:
    +        Create a constant for the no-pan-scroll radius.
    +        * rendering/RenderLayer.cpp:
    +        (WebCore::RenderLayer::panScrollFromPoint):
    +        Factor out the no-pan-scroll radius.
    +
     2009-06-12  Xan Lopez  <xlopez@igalia.com>
     
             Reviewed by Gustavo Noronha.
    Index: WebCore/page/EventHandler.cpp
    ===================================================================
    --- WebCore/page/EventHandler.cpp	(revision 44622)
    +++ WebCore/page/EventHandler.cpp	(working copy)
    @@ -661,11 +661,10 @@ void EventHandler::setPanScrollCursor()
     
         // At the original click location we draw a 4 arrowed icon. Over this icon there won't be any scroll
         // So we don't want to change the cursor over this area
    -    const int noScrollRadius = 9;
    -    bool east = m_panScrollStartPos.x() < (m_currentMousePosition.x() - noScrollRadius);
    -    bool west = m_panScrollStartPos.x() > (m_currentMousePosition.x() + noScrollRadius);
    -    bool north = m_panScrollStartPos.y() > (m_currentMousePosition.y() + noScrollRadius);
    -    bool south = m_panScrollStartPos.y() < (m_currentMousePosition.y() - noScrollRadius);
    +    bool east = m_panScrollStartPos.x() < (m_currentMousePosition.x() - ScrollView::noPanScrollRadius);
    +    bool west = m_panScrollStartPos.x() > (m_currentMousePosition.x() + ScrollView::noPanScrollRadius);
    +    bool north = m_panScrollStartPos.y() > (m_currentMousePosition.y() + ScrollView::noPanScrollRadius);
    +    bool south = m_panScrollStartPos.y() < (m_currentMousePosition.y() - ScrollView::noPanScrollRadius);
              
         if (north) {
             if (east)
    Index: WebCore/platform/ScrollView.h
    ===================================================================
    --- WebCore/platform/ScrollView.h	(revision 44622)
    +++ WebCore/platform/ScrollView.h	(working copy)
    @@ -214,7 +214,8 @@ public:
         virtual void hide();
         virtual void setParentVisible(bool);
         
    -    // Pan scrolling methods.
    +    // Pan scrolling.
    +    static const int noPanScrollRadius = 15;
         void addPanScrollIcon(const IntPoint&);
         void removePanScrollIcon();
     
    Index: WebCore/rendering/RenderLayer.cpp
    ===================================================================
    --- WebCore/rendering/RenderLayer.cpp	(revision 44622)
    +++ WebCore/rendering/RenderLayer.cpp	(working copy)
    @@ -948,7 +948,6 @@ void RenderLayer::panScrollFromPoint(con
         const int shortDistanceLimit = 100;  // We delimit a 200 pixels long square enclosing the original point
         const int speedReducer = 2;          // Within this square we divide the scrolling speed by 2
         
    -    const int iconRadius = 10;
         Frame* frame = renderer()->document()->frame();
         if (!frame)
             return;
    @@ -965,9 +964,9 @@ void RenderLayer::panScrollFromPoint(con
         int xDelta = currentMousePosition.x() - sourcePoint.x();
         int yDelta = currentMousePosition.y() - sourcePoint.y();
     
    -    if (abs(xDelta) < iconRadius) // at the center we let the space for the icon
    +    if (abs(xDelta) < ScrollView::noPanScrollRadius) // at the center we let the space for the icon
             xDelta = 0;
    -    if (abs(yDelta) < iconRadius)
    +    if (abs(yDelta) < ScrollView::noPanScrollRadius)
             yDelta = 0;
     
         // Let's attenuate the speed for the short distances
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    50b7aa71