IDEA-231689: Fix touch scroll on tap

GitOrigin-RevId: 06bd63245f6f3414ef8e44834e965e10d8ffcd59
This commit is contained in:
Denis Konoplev
2020-01-31 07:42:15 +00:00
committed by intellij-monorepo-bot
parent 8635d354aa
commit dd9b0bbfbc
2 changed files with 5 additions and 1 deletions
@@ -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) {