From b34cefbc33a3afc26dece74ea8bc42c5054efd5b Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Thu, 17 Nov 2022 12:19:04 +0100 Subject: handle invisible profile signature previews better --- .../gui/composites/configuration/SimpleConfigurationComposite.java | 3 ++- .../java/at/asit/pdfover/gui/workflow/states/PositioningState.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'pdf-over-gui') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java index 2947c387..cf24dca3 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/configuration/SimpleConfigurationComposite.java @@ -490,7 +490,8 @@ public class SimpleConfigurationComposite extends ConfigurationCompositeBase { return; if (this.sigPreview != null) this.sigPreview.dispose(); - this.sigPreview = new Image(this.getDisplay(), p.getSWTImage()); + if (p.hasImage()) + this.sigPreview = new Image(this.getDisplay(), p.getSWTImage()); this.cSigPreview.redraw(); }); }); 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 13b83999..b56fb6d7 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 @@ -121,7 +121,8 @@ 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()); + if (p.hasImage()) + this.positionComposite.setPlaceholder(p.getAWTImage()); }); if (this.previousPosition != null && !this.previousPosition.useAutoPositioning()) -- cgit v1.2.3