From b0f6d6f30ec034ce13b88407de71ebc30826a5a4 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Fri, 20 Jul 2018 22:23:35 +0900 Subject: [PATCH] fix: Fix scroll speed when range is too small --- src/renderer/components/utils/scroll.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/utils/scroll.js b/src/renderer/components/utils/scroll.js index 6b2eb86d..b2c2591e 100644 --- a/src/renderer/components/utils/scroll.js +++ b/src/renderer/components/utils/scroll.js @@ -8,13 +8,13 @@ export default function scrollTop (element, point = 0) { const range = start - point // Progress of scroll: 0 ~ 100 let progress = 0 - + const boost = range > 200 ? range / 200 : 2.0 /** * Scroll calling recursion. **/ const move = function () { progress++ - const nextPos = start - range * (range / 200) * easeOut(progress / 100) + const nextPos = start - range * boost * easeOut(progress / 100) // Stop the recursion if (nextPos <= 0) {