changeset 4017:639bdb17c3f2

Fixed offset for fairway box This was broken by changeset: 4080:bf86f9a08733 user: Thomas Junk <thomas.junk@intevation.de> 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...
author Sascha Wilde <wilde@intevation.de>
date Fri, 19 Jul 2019 16:59:25 +0200
parents 9ab7e1056360
children 796b923269a6 da3ab68875e1
files client/src/components/fairway/Fairwayprofile.vue
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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})`);
         });
       }
     },