changeset 4136:630b817d12b3 improvepdf

fairway_availability: offsets relative to svgheight and svgwidth
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 01 Aug 2019 11:22:46 +0200
parents a6eda41e7724
children a41fd26c1644
files client/src/components/fairway/AvailableFairwayDepth.vue client/src/components/fairway/AvailableFairwayDepthLNWL.vue
diffstat 2 files changed, 14 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/fairway/AvailableFairwayDepth.vue	Thu Aug 01 10:38:15 2019 +0200
+++ b/client/src/components/fairway/AvailableFairwayDepth.vue	Thu Aug 01 11:22:46 2019 +0200
@@ -331,14 +331,13 @@
     close() {
       this.$store.commit("application/paneSetup", "DEFAULT");
     },
-    getPrintLayout(svgHeight) {
+    getPrintLayout(svgHeight, svgWidth) {
       return {
-        main: { top: 0, right: 20, bottom: 50, left: 20 },
-        nav: {
-          top: svgHeight - 65,
-          right: 20,
-          bottom: 30,
-          left: 80
+        main: {
+          top: 0,
+          right: Math.floor(svgWidth * 0.025),
+          bottom: Math.floor(svgHeight * 0.17),
+          left: Math.floor(svgWidth * 0.025)
         }
       };
     },
@@ -346,7 +345,7 @@
       const elem = document.querySelector("#" + this.containerId);
       const svgWidth = elem != null ? elem.clientWidth : 0;
       const svgHeight = elem != null ? elem.clientHeight : 0;
-      const layout = this.getPrintLayout(svgHeight);
+      const layout = this.getPrintLayout(svgHeight, svgWidth);
       const dimensions = this.getDimensions({
         svgHeight,
         svgWidth,
--- a/client/src/components/fairway/AvailableFairwayDepthLNWL.vue	Thu Aug 01 10:38:15 2019 +0200
+++ b/client/src/components/fairway/AvailableFairwayDepthLNWL.vue	Thu Aug 01 11:22:46 2019 +0200
@@ -320,14 +320,13 @@
     close() {
       this.$store.commit("application/paneSetup", "DEFAULT");
     },
-    getPrintLayout(svgHeight) {
+    getPrintLayout(svgHeight, svgWidth) {
       return {
-        main: { top: 0, right: 20, bottom: 50, left: 20 },
-        nav: {
-          top: svgHeight - 65,
-          right: 20,
-          bottom: 30,
-          left: 80
+        main: {
+          top: 0,
+          right: Math.floor(svgWidth * 0.025),
+          bottom: Math.floor(svgHeight * 0.17),
+          left: Math.floor(svgWidth * 0.025)
         }
       };
     },
@@ -335,7 +334,7 @@
       const elem = document.querySelector("#" + this.containerId);
       const svgWidth = elem != null ? elem.clientWidth : 0;
       const svgHeight = elem != null ? elem.clientHeight : 0;
-      const layout = this.getPrintLayout(svgHeight);
+      const layout = this.getPrintLayout(svgHeight, svgWidth);
       const dimensions = this.getDimensions({
         svgHeight,
         svgWidth,