changeset 4750:67a5de15490b

client: fix drawing of fairwaybox border in the exported pdf * pass stroke and opacity values separately, to let svg2pdf marks the opacity * remove console.log() from old commit
author Fadi Abbud <fadi.abbud@intevation.de>
date Fri, 18 Oct 2019 16:04:22 +0200
parents fd9f171b87e4
children dbf07d0c364e
files client/src/components/fairway/Fairwayprofile.vue
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/fairway/Fairwayprofile.vue	Fri Oct 18 15:45:48 2019 +0200
+++ b/client/src/components/fairway/Fairwayprofile.vue	Fri Oct 18 16:04:22 2019 +0200
@@ -364,8 +364,6 @@
       const toRGB = s => {
         let [, r, g, b] = s.match(/.*?(\d+), (\d+), (\d+), .*/);
         const toHex = n => {
-          console.log(n);
-          console.log(parseInt(n));
           let val = parseInt(n).toString(16);
           if (val.length === 1) return `0${val}`;
           return val;
@@ -498,6 +496,12 @@
             .y1(function(d) {
               return yScaleRight(d.y);
             });
+          let strokColor = this.getLayerStyle(data.los).strokeColor;
+          // Convert stroke value to rgb() and opacity to pass them separately
+          let [r, g, b, opacity] = strokColor
+            .substring(5, strokColor.length - 1)
+            .split(",");
+          let rgb = `rgb(${r}, ${g}, ${b})`;
           graph
             .append("path")
             .datum([
@@ -505,7 +509,8 @@
               { x: endPoint, y: this.useCustomDepth ? customdepth : depth }
             ])
             .attr("fill", `${this.getLayerStyle(data.los).fillColor}`)
-            .attr("stroke", `${this.getLayerStyle(data.los).strokeColor}`)
+            .attr("stroke", rgb)
+            .attr("stroke-opacity", opacity)
             .attr("stroke-dasharray", this.getLayerStyle(data.los).strokeDash)
             .attr("d", fairwayArea)
             .attr("transform", `translate(0 ${-offsetY})`);