fix: improve movement speeds at edges

This commit is contained in:
2026-08-31 16:45:55 +02:00
parent 9bf88e033e
commit 4753d998b3
+8
View File
@@ -44,10 +44,18 @@
// Scrolling up and down
if ( relToContainer < 50 ) {
if ( relToContainer < 0 )
moveSpeed = -20;
else
moveSpeed = -Math.ceil( Math.max( 1, Math.min( 5 / relToContainer, 10 ) ) );
startTracker();
} else if ( relToContainer > height - 50 ) {
if ( height - relToContainer < 0 )
moveSpeed = 20;
else
moveSpeed = Math.ceil( Math.max( 1, Math.min( 5 / ( height - relToContainer ), 10 ) ) );
startTracker();
} else {
if ( mover >= 0 ) {