Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions HMCL/src/main/java/org/jackhuang/hmcl/ui/ScrollUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public int intDirection() {
private static final double DEFAULT_SPEED = 1.0;
private static final double DEFAULT_TRACK_PAD_ADJUSTMENT = 7.0;

private static final double CUTOFF_DELTA = 0.01;

/**
* Determines if the given ScrollEvent comes from a trackpad.
* <p></p>
Expand Down Expand Up @@ -210,7 +212,7 @@ private static void smoothScroll(ScrollPane scrollPane, double speed, double tra
break;
}

if (Math.abs(dy) < 0.001) {
if (Math.abs(dy) < CUTOFF_DELTA) {
timeline.stop();
}
}));
Expand Down Expand Up @@ -255,7 +257,7 @@ private static void smoothScroll(VirtualFlow<?> virtualFlow, double speed, doubl
double dy = derivatives[derivatives.length - 1];
virtualFlow.scrollPixels(dy);

if (Math.abs(dy) < 0.001) {
if (Math.abs(dy) < CUTOFF_DELTA) {
timeline.stop();
}
}));
Expand Down