mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-231689: Fix touch scroll on tap
GitOrigin-RevId: 06bd63245f6f3414ef8e44834e965e10d8ffcd59
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8635d354aa
commit
dd9b0bbfbc
@@ -201,7 +201,7 @@ public class JBScrollPane extends JScrollPane {
|
||||
boolean isAdjustedDeltaZero = bar instanceof JBScrollBar && ((JBScrollBar)bar).getDeltaAdjusted(event) == 0.0;
|
||||
|
||||
if (isWheelScrollEnabled && isBarVisible && !isAdjustedDeltaZero) {
|
||||
if (UISettings.getShadowInstance().getAnimatedScrolling()) {
|
||||
if (UISettings.getShadowInstance().getAnimatedScrolling() || TouchScrollUtil.isTouchScroll(event)) {
|
||||
if (mySmoothScroll == null) {
|
||||
mySmoothScroll = MouseWheelSmoothScroll.create(() -> {
|
||||
return ScrollSettings.isEligibleFor(pane);
|
||||
|
||||
@@ -154,6 +154,9 @@ public class MouseWheelSmoothScroll {
|
||||
}
|
||||
|
||||
private static int getRoundedAtLeastToOne(double value) {
|
||||
if (value == 0.0) {
|
||||
return 0;
|
||||
}
|
||||
if (abs(value) < 1) {
|
||||
return value > 0 ? 1 : -1;
|
||||
}
|
||||
@@ -248,6 +251,7 @@ public class MouseWheelSmoothScroll {
|
||||
|
||||
public void registerBegin() {
|
||||
beginTime = System.currentTimeMillis();
|
||||
lastDelta = 0;
|
||||
}
|
||||
|
||||
public void registerUpdate(int delta) {
|
||||
|
||||
Reference in New Issue
Block a user