diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-09-01 13:16:36 +0200 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-09-01 13:16:36 +0200 |
commit | d328326156cdfbf96581f0f22b3b0d195fbc6858 (patch) | |
tree | c9cfe2b1d6243fef7dedb9496fa02a4683ba5882 /pdf-over-gui/src/main/java/at/asit | |
parent | 8e553385ab268c216a99b03d15783c563ce748dc (diff) | |
download | pdf-over-d328326156cdfbf96581f0f22b3b0d195fbc6858.tar.gz pdf-over-d328326156cdfbf96581f0f22b3b0d195fbc6858.tar.bz2 pdf-over-d328326156cdfbf96581f0f22b3b0d195fbc6858.zip |
cleanup emblem handling
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java | 3 | ||||
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java | 8 |
2 files changed, 7 insertions, 4 deletions
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 87ec0c42..bad000ea 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 @@ -513,6 +513,9 @@ public class SignaturePanel extends JPanel { */
boolean isOnSignature(int x, int y)
{
+ if (this.sigScreenPos == null)
+ return false;
+
Rectangle2D sig = new Rectangle2D.Double(
this.sigScreenPos.getX() + this.offX,
this.sigScreenPos.getY() + this.offY,
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java index febf392a..e3ab559c 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java @@ -110,8 +110,9 @@ public class PositioningState extends State { PdfAs4SignatureParameter param = new PdfAs4SignatureParameter(); param.signatureProfile = config.getSignatureProfile(); - Emblem emblem = new Emblem(config.getDefaultEmblemPath()); - param.emblem = emblem; + String emblemPath = config.getDefaultEmblemPath(); + if (emblemPath != null && !emblemPath.trim().isEmpty()) + param.emblem = new Emblem(emblemPath); if (config.getSignatureNote() != null && !config.getSignatureNote().isEmpty()) param.signatureNote = config.getSignatureNote(); @@ -120,8 +121,7 @@ public class PositioningState extends State { param.targetLogoSize = Math.min(120.0, config.getLogoOnlyTargetSize()); // TODO WORKAROUND FOR #117 PdfAs4SignaturePlaceholder.For(param, (p) -> { - this.positionComposite.setPlaceholder( - p.getAWTImage()); + this.positionComposite.setPlaceholder(p.getAWTImage()); }); if (this.previousPosition != null && !this.previousPosition.useAutoPositioning()) |