From d4fa9356a5084c9371be405b63ea4bffd9085b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 28 Feb 2021 07:52:28 +0100 Subject: [PATCH] Scroll speed back to normal on ActionScript/P-code editors --- .../decompiler/flash/gui/FasterScrollPane.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/gui/FasterScrollPane.java b/src/com/jpexs/decompiler/flash/gui/FasterScrollPane.java index 5dffbfbf8..bcbe88e5e 100644 --- a/src/com/jpexs/decompiler/flash/gui/FasterScrollPane.java +++ b/src/com/jpexs/decompiler/flash/gui/FasterScrollPane.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.gui; import java.awt.Component; import javax.swing.JScrollPane; +import javax.swing.Scrollable; /** * @@ -27,26 +28,26 @@ public class FasterScrollPane extends JScrollPane { public FasterScrollPane(Component view) { super(view); - initSpeed(); } public FasterScrollPane() { super(); - initSpeed(); } public FasterScrollPane(int vsbPolicy, int hsbPolicy) { super(vsbPolicy, hsbPolicy); - initSpeed(); } public FasterScrollPane(Component view, int vsbPolicy, int hsbPolicy) { super(view, vsbPolicy, hsbPolicy); - initSpeed(); } - private void initSpeed() { - getVerticalScrollBar().setUnitIncrement(20); + @Override + public void setViewportView(Component view) { + super.setViewportView(view); + if (!(view instanceof Scrollable)) { + getVerticalScrollBar().setUnitIncrement(20); + } } }