# HG changeset patch # User Fadi Abbud # Date 1571407462 -7200 # Node ID 67a5de15490b2f5a04b94c502b7f0803f5ca70fc # Parent fd9f171b87e4aebabe03dd9f702dc75e2206e3ac 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 diff -r fd9f171b87e4 -r 67a5de15490b client/src/components/fairway/Fairwayprofile.vue --- 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})`);