changeset 4138:33deb8634783 improvepdf

mixin: set relative defaults for margins
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 01 Aug 2019 11:57:36 +0200
parents a41fd26c1644
children 0becdd2812c9
files client/src/lib/mixins.js
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/lib/mixins.js	Thu Aug 01 11:47:27 2019 +0200
+++ b/client/src/lib/mixins.js	Thu Aug 01 11:57:36 2019 +0200
@@ -52,16 +52,16 @@
   methods: {
     getDimensions({ svgWidth, svgHeight, main, nav }) {
       const mainMargin = main || {
-        top: 20,
-        right: 80,
-        bottom: 60,
-        left: 80
+        top: Math.floor(0.08 * svgHeight),
+        right: Math.floor(0.08 * svgWidth),
+        bottom: Math.floor(0.2 * svgHeight),
+        left: Math.floor(0.08 * svgWidth)
       };
       const navMargin = nav || {
-        top: svgHeight - mainMargin.top - 65,
-        right: 20,
-        bottom: 30,
-        left: 80
+        top: Math.floor(0.78 * svgHeight),
+        right: Math.floor(0.013 * svgWidth),
+        bottom: Math.floor(0.095 * svgHeight),
+        left: Math.floor(0.07 * svgWidth)
       };
       const width = Number(svgWidth) - mainMargin.left - mainMargin.right;
       const mainHeight = Number(svgHeight) - mainMargin.top - mainMargin.bottom;