diff client/src/components/fairway/Fairwayprofile.vue @ 4743:ac2c82719f7b

fairway profile: fix box rendering
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 18 Oct 2019 12:55:50 +0200
parents a83e4721baaf
children 67a5de15490b
line wrap: on
line diff
--- a/client/src/components/fairway/Fairwayprofile.vue	Fri Oct 18 12:18:23 2019 +0200
+++ b/client/src/components/fairway/Fairwayprofile.vue	Fri Oct 18 12:55:50 2019 +0200
@@ -485,11 +485,10 @@
       for (let data of this.fairwayData) {
         data.coordinates.forEach(coordinates => {
           const [startPoint, endPoint, depth] = coordinates;
+          const referenceDepth =
+            this.maxAlt * 1.1 + (this.waterlevel - this.refWaterlevel) / 100;
           let customdepth =
-            this.depth < this.maxAlt * 1.1
-              ? this.depth
-              : this.maxAlt * 1.1 +
-                (this.waterlevel - this.refWaterlevel) / 100;
+            this.depth < referenceDepth ? this.depth : referenceDepth;
           let fairwayArea = d3
             .area()
             .x(function(d) {