diff options
Diffstat (limited to 'pdf-over-gui/src')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java | 9 | ||||
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java | 4 |
2 files changed, 10 insertions, 3 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 1ca05015..7f42db8f 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 @@ -409,9 +409,12 @@ public class PositioningComposite extends StateComposite { * the signature position */ void setFinalPosition() { - this.position = new SignaturePosition( - this.viewer.getSignaturePositionX(), - this.viewer.getSignaturePositionY(), this.currentPage); + if (this.currentPage == 0) + this.position = new SignaturePosition(); + else + this.position = new SignaturePosition( + this.viewer.getSignaturePositionX(), + this.viewer.getSignaturePositionY(), this.currentPage); PositioningComposite.this.state.updateStateMachine(); } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java index 264ccd2f..34c1112f 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java @@ -198,6 +198,8 @@ public class SignaturePanel extends JPanel { * @return signature x coordinate */ public float getSignaturePositionX() { + if (this.sigPagePos == null) + return 0; return Math.max((float) this.sigPagePos.getX(), 0); } @@ -206,6 +208,8 @@ public class SignaturePanel extends JPanel { * @return signature y coordinate */ public float getSignaturePositionY() { + if (this.sigPagePos == null) + return 0; return Math.max((float) this.sigPagePos.getY(), 0); } |