Mercurial > gemma
diff client/src/components/fairway/Fairwayprofile.vue @ 3906:ec1d91fdd6a2
fairway_profile: print template edited and print mechanism improved
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Wed, 10 Jul 2019 17:08:28 +0200 |
parents | 9dfd225b92e8 |
children | 976c83b6f479 |
line wrap: on
line diff
--- a/client/src/components/fairway/Fairwayprofile.vue Wed Jul 10 17:01:36 2019 +0200 +++ b/client/src/components/fairway/Fairwayprofile.vue Wed Jul 10 17:08:28 2019 +0200 @@ -188,8 +188,8 @@ type: "diagram", position: "topleft", offset: { x: 20, y: 60 }, - width: 290, - height: 100 + width: 280, + height: 90 }, { type: "diagramtitle", @@ -368,18 +368,17 @@ addDiagram(position, offset, width, height) { let x = offset.x, y = offset.y; - const svgWidth = this.millimeter2pixels(width, 80); - const svgHeight = this.millimeter2pixels(height, 80); - // check if there are tow diagrams on the screen - // draw the diagram in a separated html element to get the full size + const resolution = this.templateData.properties.resolution || 80; + const svgWidth = this.millimeter2pixels(width, resolution); + const svgHeight = this.millimeter2pixels(height, resolution); const offScreen = document.querySelector("#offScreen"); offScreen.style.width = `${svgWidth}px`; offScreen.style.height = `${svgHeight}px`; this.renderTo({ element: offScreen, dimensions: { - svgWidth: svgWidth - this.margin.right - this.margin.left, - svgHeight: svgHeight - this.margin.top - this.margin.bottom + svgWidth: svgWidth, + svgHeight: svgHeight } }); var svg = offScreen.querySelector("svg"); @@ -400,7 +399,7 @@ xOffset: x, yOffset: y, // TODO depend on the size and aspect ration on paper - scale: 0.2 + scale: this.templateData.properties.paperSize === "a3" ? 0.3 : 0.27 }); offScreen.removeChild(svg); },