Changeset 220638 in webkit


Ignore:
Timestamp:
Aug 13, 2017 11:23:27 PM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] stop kinetic scrolling when a zero movement is reached
https://bugs.webkit.org/show_bug.cgi?id=175468

Reviewed by Michael Catanzaro.

This is GTK+ change by Christian Hergert.
https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=4f63d839550f7a9038b391e7d3e1e6fc8bdfafa6

When the kinetic scrolling reduces its speed, there can be multiple frames where the movement is zero pixels,
followed by a 1 pixel movement later on. This causes a "jitter" right at the end of the scroll which makes it
feel less quality than other platforms. Instead, we should just clamp it as soon as we get a zero movement.

  • platform/ScrollAnimationKinetic.cpp:

(WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r220632 r220638  
     12017-08-13  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] stop kinetic scrolling when a zero movement is reached
     4        https://bugs.webkit.org/show_bug.cgi?id=175468
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        This is GTK+ change by Christian Hergert.
     9        https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=4f63d839550f7a9038b391e7d3e1e6fc8bdfafa6
     10
     11        When the kinetic scrolling reduces its speed, there can be multiple frames where the movement is zero pixels,
     12        followed by a 1 pixel movement later on. This causes a "jitter" right at the end of the scroll which makes it
     13        feel less quality than other platforms. Instead, we should just clamp it as soon as we get a zero movement.
     14
     15        * platform/ScrollAnimationKinetic.cpp:
     16        (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
     17
    1182017-08-13  Chris Dumez  <cdumez@apple.com>
    219
  • trunk/Source/WebCore/platform/ScrollAnimationKinetic.cpp

    r217971 r220638  
    8282bool ScrollAnimationKinetic::PerAxisData::animateScroll(Seconds timeDelta)
    8383{
     84    auto lastPosition = m_position;
     85    auto lastTime = m_elapsedTime;
    8486    m_elapsedTime += timeDelta;
    8587
     
    9496        m_position = m_upper;
    9597        m_velocity = 0;
    96     } else if (fabs(m_velocity) < 1) {
     98    } else if (fabs(m_velocity) < 1 || (lastTime && fabs(m_position - lastPosition) < 1)) {
    9799        m_position = round(m_position);
    98100        m_velocity = 0;
Note: See TracChangeset for help on using the changeset viewer.