summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-06-03 13:40:29 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-06-03 13:40:29 +0200
commit872dbc989a692d51e9718c399ce62e4212783455 (patch)
tree887f237cc13501fc6213bb81343377e880dc6b4f /pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites
parentb9de22acd1f0ced739e90826e9358b35e4004a8b (diff)
downloadpdf-over-872dbc989a692d51e9718c399ce62e4212783455.tar.gz
pdf-over-872dbc989a692d51e9718c399ce62e4212783455.tar.bz2
pdf-over-872dbc989a692d51e9718c399ce62e4212783455.zip
shift scrolls by 5 pages (cf. #94)
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java7
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)