changeset 2080:1dafdbfca100

client: pdf-gen: clean up: addtext function * stop addtext function from drawiang backgrund its already in another function
author Fadi Abbud <fadi.abbud@intevation.de>
date Thu, 31 Jan 2019 11:29:43 +0100
parents 9318973487a1
children 40711ca3aa19
files client/src/components/Pdftool.vue
diffstat 1 files changed, 0 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/Pdftool.vue	Wed Jan 30 23:57:51 2019 +0100
+++ b/client/src/components/Pdftool.vue	Thu Jan 31 11:29:43 2019 +0100
@@ -360,32 +360,6 @@
     addText(doc, postitionX, positionY, size, color, lineWidth, text) {
       // split the incoming string to an array, each element is a string of words in a single line
       var textLines = doc.splitTextToSize(text, lineWidth);
-      // get the longest line to fit the white backround to it
-      var longestString = "";
-      textLines.forEach(function(element) {
-        if (element.length > longestString.length) longestString = element;
-      });
-      var indexOfMaxString = textLines.indexOf(longestString);
-      // white background (rectangular) around the text
-      doc.setFillColor(255, 255, 255);
-      doc.setDrawColor(255, 255, 255);
-      doc.rect(
-        postitionX - doc.getStringUnitWidth(textLines[indexOfMaxString]) / size,
-        size > 10 ? positionY - size / 1.8 : positionY - size / 2.4,
-        doc.getStringUnitWidth(textLines[indexOfMaxString]) * (size / 2.6),
-        textLines.length * (size / 2),
-        "FD"
-      );
-      //rounded rectangular
-      /* doc.roundedRect(
-        postitionX - doc.getStringUnitWidth(textLines[indexOfMaxString]) / size,
-        size > 10 ? positionY - size / 1.8 : positionY - size / 2.6,
-        doc.getStringUnitWidth(textLines[indexOfMaxString]) * (size / 2.6),
-        textLines.length * (size / 2),
-        3,
-        3,
-        "FD"
-      ); */
       doc.setTextColor(color);
       doc.setFontSize(size);
       doc.text(postitionX, positionY, textLines);