# HG changeset patch # User Sascha Wilde # Date 1563548365 -7200 # Node ID 639bdb17c3f23a85fc65e40c25e33259edf93ea5 # Parent 9ab7e10563609e094f648579ed43d24c95140032 Fixed offset for fairway box This was broken by changeset: 4080:bf86f9a08733 user: Thomas Junk Date: Thu Jul 18 15:04:30 2019 +0200 summary: improve fairwaydiagram printing positioning For the record: I think the current implementation exceptionally flawed. Instead of adding extra offset parameters to the diagram elements the whole building block with all contained elements should be translated in one step, that would be less cluttered and less error prone... diff -r 9ab7e1056360 -r 639bdb17c3f2 client/src/components/fairway/Fairwayprofile.vue --- a/client/src/components/fairway/Fairwayprofile.vue Fri Jul 19 14:30:14 2019 +0200 +++ b/client/src/components/fairway/Fairwayprofile.vue Fri Jul 19 16:59:25 2019 +0200 @@ -449,9 +449,9 @@ offsetY }); } - this.drawFairway({ graph, xScale, yScaleRight }); + this.drawFairway({ graph, xScale, yScaleRight, offsetY }); }, - drawFairway({ graph, xScale, yScaleRight }) { + drawFairway({ graph, xScale, yScaleRight, offsetY }) { if (this.fairwayData === undefined) { return; } @@ -491,7 +491,8 @@ ) .attr("stroke-opacity", this.getLayerStyle(data.los).strokeOpacity) .attr("stroke-dasharray", this.getLayerStyle(data.los).strokeDash) - .attr("d", fairwayArea); + .attr("d", fairwayArea) + .attr("transform", `translate(0 ${-offsetY})`); }); } },