From 56614cde906eda5b24bc77dbee298cfa39cbecfb Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Mon, 12 Jul 2021 14:22:28 +0200 Subject: page selection range limited --- .../java/at/asit/pdfover/gui/composites/PositioningComposite.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pdf-over-gui/src/main/java') 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); } }; -- cgit v1.2.3