Changeset 38312 in webkit


Ignore:
Timestamp:
Nov 11, 2008 12:43:57 PM (15 years ago)
Author:
hyatt@apple.com
Message:

2008-11-11 David Hyatt <hyatt@apple.com>

https://bugs.webkit.org/show_bug.cgi?id=22182

Fix problems with scrollbars when the OS setting for clicks in the track jumping the thumb to that location
is turned on. Make sure to only jump the thumb if the click happens in the track. Also fix some math
errors when jumping the thumb that cause dragging after the jump to incorrectly jump the thumb again.

Reviewed by Adele

  • platform/Scrollbar.cpp: (WebCore::Scrollbar::mouseDown):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r38310 r38312  
     12008-11-11  David Hyatt  <hyatt@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=22182
     4
     5        Fix problems with scrollbars when the OS setting for clicks in the track jumping the thumb to that location
     6        is turned on.  Make sure to only jump the thumb if the click happens in the track.  Also fix some math
     7        errors when jumping the thumb that cause dragging after the jump to incorrectly jump the thumb again.
     8
     9        Reviewed by Adele
     10
     11        * platform/Scrollbar.cpp:
     12        (WebCore::Scrollbar::mouseDown):
     13
    1142008-11-11  Beth Dakin  <bdakin@apple.com>
    215
  • trunk/WebCore/platform/Scrollbar.cpp

    r38130 r38312  
    365365    int pressedPos = (orientation() == HorizontalScrollbar ? convertFromContainingWindow(evt.pos()).x() : convertFromContainingWindow(evt.pos()).y());
    366366   
    367     if (theme()->shouldCenterOnThumb(this, evt)) {
     367    if ((pressedPart() == BackTrackPart || pressedPart() == ForwardTrackPart) && theme()->shouldCenterOnThumb(this, evt)) {
    368368        setHoveredPart(ThumbPart);
    369369        setPressedPart(ThumbPart);
    370370        int thumbLen = theme()->thumbLength(this);
    371         int desiredPos = pressedPos - thumbLen / 2;
    372         // Set the pressed position to the top of the thumb so that when we do the move, the delta
     371        int desiredPos = pressedPos;
     372        // Set the pressed position to the middle of the thumb so that when we do the move, the delta
    373373        // will be from the current pixel position of the thumb to the new desired position for the thumb.
    374         m_pressedPos = theme()->trackPosition(this) + theme()->thumbPosition(this);
     374        m_pressedPos = theme()->trackPosition(this) + theme()->thumbPosition(this) + thumbLen / 2;
    375375        moveThumb(desiredPos);
    376376        return true;
Note: See TracChangeset for help on using the changeset viewer.