comparison client/src/lib/mixins.js @ 3886:9fa9a485c182

mixins: calculator for pixels2millimeter vice versa
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 10 Jul 2019 12:19:23 +0200
parents 7db6999962db
children ec1d91fdd6a2
comparison
equal deleted inserted replaced
3885:d42158f77841 3886:9fa9a485c182
130 computed: { 130 computed: {
131 ...mapState("application", ["logoForPDF"]), 131 ...mapState("application", ["logoForPDF"]),
132 ...mapState("user", ["user"]) 132 ...mapState("user", ["user"])
133 }, 133 },
134 methods: { 134 methods: {
135 millimeter2pixels(length, dpi) {
136 return (dpi * length) / 25.4;
137 },
138 pixel2millimeter(pixels, dpi) {
139 return (pixels * 25.4) / dpi;
140 },
135 gaugeInfo(selectedGauge) { 141 gaugeInfo(selectedGauge) {
136 // returns string with formatted gauge info 142 // returns string with formatted gauge info
137 return ( 143 return (
138 selectedGauge.properties.objname + 144 selectedGauge.properties.objname +
139 " (" + 145 " (" +