# HG changeset patch # User Thomas Junk # Date 1564651366 -7200 # Node ID 630b817d12b36af707d02bcee448a004bce6b555 # Parent a6eda41e772489ff16e0c5ff6e7060407bb8c9b9 fairway_availability: offsets relative to svgheight and svgwidth diff -r a6eda41e7724 -r 630b817d12b3 client/src/components/fairway/AvailableFairwayDepth.vue --- 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, diff -r a6eda41e7724 -r 630b817d12b3 client/src/components/fairway/AvailableFairwayDepthLNWL.vue --- 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,