From 853c0269914471c48947fa8fd0b4ca326163fa65 Mon Sep 17 00:00:00 2001 From: Wakefield Morys-Carter Date: Fri, 16 Apr 2021 21:58:51 +0100 Subject: [PATCH] reset mouseY --- scroll-text-legacy-browsers.js | 3 ++- scroll-text.js | 3 ++- scroll-text.psyexp | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scroll-text-legacy-browsers.js b/scroll-text-legacy-browsers.js index fccbd36..373262a 100644 --- a/scroll-text-legacy-browsers.js +++ b/scroll-text-legacy-browsers.js @@ -367,7 +367,8 @@ function trialRoutineEachFrame(snapshot) { dragging = 1; mouseY = mouse.getPos()[1]; } else { - scroll += ((mouse.getPos()[1] - mouseY) / 1.08); + scroll += (((mouse.getPos()[1] - mouseY) / fontSize) / 1.08); + mouseY = mouse.getPos()[1]; moving = 1; } } else { diff --git a/scroll-text.js b/scroll-text.js index eb016fb..c24cac9 100644 --- a/scroll-text.js +++ b/scroll-text.js @@ -376,7 +376,8 @@ function trialRoutineEachFrame(snapshot) { dragging = 1; mouseY = mouse.getPos()[1]; } else { - scroll += ((mouse.getPos()[1] - mouseY) / 1.08); + scroll += (((mouse.getPos()[1] - mouseY) / fontSize) / 1.08); + mouseY = mouse.getPos()[1]; moving = 1; } } else { diff --git a/scroll-text.psyexp b/scroll-text.psyexp index bea34a3..94bc3c5 100644 --- a/scroll-text.psyexp +++ b/scroll-text.psyexp @@ -79,8 +79,8 @@ - - + + -- 2.18.1