From ad6748e177322e29d5fe418fbc69bbc45a63af44 Mon Sep 17 00:00:00 2001 From: Marco Rebhan Date: Thu, 29 Apr 2021 00:25:22 +0200 Subject: Fix scroll speed being dependent on the line count in the file. Closes #383. --- enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java index 61b48ce8..8f020b8a 100644 --- a/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java +++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/panels/EditorPanel.java @@ -99,6 +99,10 @@ public class EditorPanel { DefaultSyntaxKit kit = (DefaultSyntaxKit) this.editor.getEditorKit(); kit.toggleComponent(this.editor, "de.sciss.syntaxpane.components.TokenMarker"); + // set unit increment to height of one line, the amount scrolled per + // mouse wheel rotation is then controlled by OS settings + this.editorScrollPane.getVerticalScrollBar().setUnitIncrement(this.editor.getFontMetrics(this.editor.getFont()).getHeight()); + // init editor popup menu this.popupMenu = new EditorPopupMenu(this, gui); this.editor.setComponentPopupMenu(this.popupMenu.getUi()); -- cgit v1.2.3