summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at
diff options
context:
space:
mode:
authorAndreas Abraham <andreas.abraham@egiz.gv.at>2021-07-12 14:22:28 +0200
committerAndreas Abraham <andreas.abraham@egiz.gv.at>2021-07-12 14:22:28 +0200
commit56614cde906eda5b24bc77dbee298cfa39cbecfb (patch)
tree2ddadb304c138de184d21eeee33b4bf9a086c98e /pdf-over-gui/src/main/java/at
parentfe4f1f9e8fc1686706314f62401f0ecd4480c4a6 (diff)
downloadpdf-over-56614cde906eda5b24bc77dbee298cfa39cbecfb.tar.gz
pdf-over-56614cde906eda5b24bc77dbee298cfa39cbecfb.tar.bz2
pdf-over-56614cde906eda5b24bc77dbee298cfa39cbecfb.zip
page selection range limited
Diffstat (limited to 'pdf-over-gui/src/main/java/at')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java7
1 files changed, 6 insertions, 1 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 82a5a7a9..77b8c7c3 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
@@ -326,7 +326,12 @@ public class PositioningComposite extends StateComposite {
@Override
public void widgetSelected(SelectionEvent e) {
System.out.println("selection: " + PositioningComposite.this.scrollbar.getSelection());
- PositioningComposite.this.showPage(PositioningComposite.this.scrollbar.getSelection());
+ int selection = PositioningComposite.this.scrollbar.getSelection();
+ if (selection < 0) {
+ selection = 0;
+ System.out.println("corrected selecttion to: " + selection);
+ }
+ PositioningComposite.this.showPage(selection);
}
};