mirror of
https://github.com/janishutz/MusicPlayer.git
synced 2026-09-10 14:25:24 +02:00
fix: improve movement speeds at edges
This commit is contained in:
@@ -44,10 +44,18 @@
|
|||||||
|
|
||||||
// Scrolling up and down
|
// Scrolling up and down
|
||||||
if ( relToContainer < 50 ) {
|
if ( relToContainer < 50 ) {
|
||||||
|
if ( relToContainer < 0 )
|
||||||
|
moveSpeed = -20;
|
||||||
|
else
|
||||||
moveSpeed = -Math.ceil( Math.max( 1, Math.min( 5 / relToContainer, 10 ) ) );
|
moveSpeed = -Math.ceil( Math.max( 1, Math.min( 5 / relToContainer, 10 ) ) );
|
||||||
|
|
||||||
startTracker();
|
startTracker();
|
||||||
} else if ( relToContainer > height - 50 ) {
|
} else if ( relToContainer > height - 50 ) {
|
||||||
|
if ( height - relToContainer < 0 )
|
||||||
|
moveSpeed = 20;
|
||||||
|
else
|
||||||
moveSpeed = Math.ceil( Math.max( 1, Math.min( 5 / ( height - relToContainer ), 10 ) ) );
|
moveSpeed = Math.ceil( Math.max( 1, Math.min( 5 / ( height - relToContainer ), 10 ) ) );
|
||||||
|
|
||||||
startTracker();
|
startTracker();
|
||||||
} else {
|
} else {
|
||||||
if ( mover >= 0 ) {
|
if ( mover >= 0 ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user