You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by sk...@apache.org on 2020/04/09 13:10:00 UTC
[netbeans] branch master updated: [NETBEANS-3870] FlatLaf and
Windows LaF: fixed smooth scrolling in editors,
Output view and Debugging view
This is an automated email from the ASF dual-hosted git repository.
skygo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new d09fd5b [NETBEANS-3870] FlatLaf and Windows LaF: fixed smooth scrolling in editors, Output view and Debugging view
new f83842b Merge pull request #2058 from DevCharly/flatlaf-smooth-scrolling
d09fd5b is described below
commit d09fd5bad5397e6325019f755c434022d86c8adb
Author: Karl Tauber <ka...@jformdesigner.com>
AuthorDate: Wed Apr 1 16:46:06 2020 +0200
[NETBEANS-3870] FlatLaf and Windows LaF: fixed smooth scrolling in editors, Output view and Debugging view
---
.../src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java | 2 +-
.../modules/debugger/ui/views/debugging/DebuggingViewComponent.java | 2 +-
.../src/org/netbeans/core/output2/ui/AbstractOutputPane.java | 6 ++++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java b/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java
index 80f1b9a..3eceac7 100644
--- a/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java
+++ b/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/view/DocumentViewOp.java
@@ -1510,7 +1510,7 @@ public final class DocumentViewOp
JTextComponent textComponent = docView.getTextComponent();
Keymap keymap = textComponent.getKeymap();
- int wheelRotation = evt.getWheelRotation();
+ double wheelRotation = evt.getPreciseWheelRotation();
if (wheelRotation < 0) {
Action action = keymap.getAction(KeyStroke.getKeyStroke(0x290, modifiers)); //WHEEL_UP constant
if (action != null) {
diff --git a/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/DebuggingViewComponent.java b/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/DebuggingViewComponent.java
index ac61de4..5501cb4 100644
--- a/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/DebuggingViewComponent.java
+++ b/ide/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/views/debugging/DebuggingViewComponent.java
@@ -873,7 +873,7 @@ public class DebuggingViewComponent extends TopComponent implements org.openide.
public void mouseWheelMoved(MouseWheelEvent e) {
JScrollBar scrollBar = mainScrollPane.getVerticalScrollBar();
if (e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
- int totalScrollAmount = e.getUnitsToScroll() * scrollBar.getUnitIncrement();
+ int totalScrollAmount = (int) (e.getPreciseWheelRotation() * e.getScrollAmount() * scrollBar.getUnitIncrement());
scrollBar.setValue(scrollBar.getValue() + totalScrollAmount);
}
}
diff --git a/platform/core.output2/src/org/netbeans/core/output2/ui/AbstractOutputPane.java b/platform/core.output2/src/org/netbeans/core/output2/ui/AbstractOutputPane.java
index 31f4580..13027fe 100644
--- a/platform/core.output2/src/org/netbeans/core/output2/ui/AbstractOutputPane.java
+++ b/platform/core.output2/src/org/netbeans/core/output2/ui/AbstractOutputPane.java
@@ -822,7 +822,8 @@ public abstract class AbstractOutputPane extends JScrollPane implements Document
} else if (e.isShiftDown()) { // horizontal scrolling
BoundedRangeModel sbmodel = getHorizontalScrollBar().getModel();
int currPosition = sbmodel.getValue();
- int newPosition = Math.max(0, Math.min(sbmodel.getMaximum(), currPosition + (e.getUnitsToScroll()) * fontWidth));
+ int newPosition = Math.max(0, Math.min(sbmodel.getMaximum(), currPosition
+ + (int) (e.getPreciseWheelRotation() * e.getScrollAmount() * fontWidth)));
sbmodel.setValue (newPosition);
return;
}
@@ -832,7 +833,8 @@ public abstract class AbstractOutputPane extends JScrollPane implements Document
int currPosition = sbmodel.getValue();
if (e.getSource() == textView) {
- int newPosition = Math.max(0, Math.min(sbmodel.getMaximum(), currPosition + (e.getUnitsToScroll() * fontHeight)));
+ int newPosition = Math.max(0, Math.min(sbmodel.getMaximum(), currPosition
+ + (int) (e.getPreciseWheelRotation() * e.getScrollAmount() * fontHeight)));
// height is a magic constant because of #57532
sbmodel.setValue (newPosition);
if (newPosition + range >= max) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists