changeset 3960:4268bb8e2839

clinet: pdf-gen: fix addText function in pdftool * set default width value to avoid stop rendering of elements if its missed in the template-definition
author Fadi Abbud <fadi.abbud@intevation.de>
date Tue, 16 Jul 2019 16:54:55 +0200
parents 66a421f3e3a6
children 9d395217bd1f
files client/src/components/Pdftool.vue
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/Pdftool.vue	Tue Jul 16 13:04:13 2019 +0200
+++ b/client/src/components/Pdftool.vue	Tue Jul 16 16:54:55 2019 +0200
@@ -364,14 +364,15 @@
               defaultBgColor = "white",
               defaultPadding = 3,
               defaultOffset = { x: 0, y: 0 },
-              defaultBorderColor = "white";
+              defaultBorderColor = "white",
+              defaultWidth = 100;
             this.templateData.elements.forEach(e => {
               switch (e.type) {
                 case "text": {
                   this.addText(
                     e.position,
                     e.offset || defaultOffset,
-                    e.width,
+                    e.width || defaultWidth,
                     e.fontSize || defaultFontSize,
                     e.color || defaultTextColor,
                     e.text