diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-06-03 13:40:29 +0200 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-06-03 13:40:29 +0200 |
commit | 872dbc989a692d51e9718c399ce62e4212783455 (patch) | |
tree | 887f237cc13501fc6213bb81343377e880dc6b4f | |
parent | b9de22acd1f0ced739e90826e9358b35e4004a8b (diff) | |
download | pdf-over-872dbc989a692d51e9718c399ce62e4212783455.tar.gz pdf-over-872dbc989a692d51e9718c399ce62e4212783455.tar.bz2 pdf-over-872dbc989a692d51e9718c399ce62e4212783455.zip |
shift scrolls by 5 pages (cf. #94)
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java index 0c2a54b4..c38a9427 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java @@ -316,14 +316,13 @@ public class PositioningComposite extends StateComposite { return; this.lastEventTime = e.getWhen(); + int change = e.isShiftDown() ? 5 : 1; int newPage = PositioningComposite.this.currentPage; if (e.getWheelRotation() < 0) { - if (PositioningComposite.this.currentPage > 1) - newPage--; + newPage = Math.max(1, newPage - change); } else if (e.getWheelRotation() > 0) { - if (PositioningComposite.this.currentPage < PositioningComposite.this.numPages) - newPage++; + newPage = Math.min(newPage + change, PositioningComposite.this.numPages); } if (newPage != PositioningComposite.this.currentPage) |