cpp(fix): Update scroll friction at edges (#10719) 36a2a4b4db Co-authored-by: Philip Chung <philterdesign@gmail.com>
diff --git a/.rive_head b/.rive_head index 5f52400..4845ed7 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -fd286173b1412e73461cedaf2007c5c27b50ca4b +36a2a4b4db1a2cfd0612955697b21d8c7e440217
diff --git a/src/constraints/scrolling/elastic_scroll_physics.cpp b/src/constraints/scrolling/elastic_scroll_physics.cpp index 2325cde..e94e848 100644 --- a/src/constraints/scrolling/elastic_scroll_physics.cpp +++ b/src/constraints/scrolling/elastic_scroll_physics.cpp
@@ -101,17 +101,16 @@ { m_current += m_speed * elapsedSeconds; - auto friction = m_friction; if (m_current < m_runRangeMin) { - friction *= 4; + m_friction *= 4; } else if (m_current > m_runRangeMax) { - friction *= 4; + m_friction *= 4; } - m_speed += -m_speed * std::min(1.0f, elapsedSeconds * friction); + m_speed += -m_speed * std::min(1.0f, elapsedSeconds * m_friction); if (abs(m_speed) < 5) {