From d953fe519c05d14aa81c77ca35011033e2cf7e2c Mon Sep 17 00:00:00 2001 From: = Date: Thu, 9 Jul 2020 16:06:36 +0200 Subject: [PATCH] fix warmers --- .../components/base-components/resistance.vue | 1 + .../components/base-components/warmers.ts | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/resistance.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/resistance.vue index 38c30e7f..89077b38 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/resistance.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/resistance.vue @@ -3,6 +3,7 @@ class="resistance" :key="selected" @click="$emit('click')" + v-on:touchend="$emit('click')" :style="{backgroundColor:`rgb(${currentColor})`}" >{{channel.setpointHMI}} % diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/warmers.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/warmers.ts index 89297640..9e36455f 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/warmers.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/setup/riscaldi/components/base-components/warmers.ts @@ -119,6 +119,17 @@ export default class Warmers extends Vue { controlIconsEnabled: false, fit: true, center: true, + beforePan: function () { + var z = this.getZoom(); + return z > 1; + }, + beforeZoom: function (o, n) { + if (n <= 1) { + this.center(); this.fit(); + return false; + } + return true; + } }); }, 500) } @@ -154,6 +165,8 @@ export default class Warmers extends Vue { let point1 = (this.$refs.warmer as SVGSVGElement)?.createSVGPoint(); let point2 = (this.$refs.warmer as SVGSVGElement)?.createSVGPoint(); + let point3 = (this.$refs.warmer as SVGSVGElement)?.createSVGPoint(); + let point4 = (this.$refs.warmer as SVGSVGElement)?.createSVGPoint(); if (lazo && point1 && point2) for (const row of this.rows) { @@ -162,8 +175,12 @@ export default class Warmers extends Vue { point1.y = row * this.height; point2.x = point1.x + this.width * cell.dimension; point2.y = point1.y + this.height; + point3.x = point1.x; + point3.y = point2.y; + point4.x = point2.x; + point4.y = point1.y; - if (lazo.isPointInFill(point1) && lazo.isPointInFill(point2)) { + if (lazo.isPointInFill(point1) || lazo.isPointInFill(point2) || lazo.isPointInFill(point3) || lazo.isPointInFill(point4)) { captured.add(cell.idChannel); } }