diff --git a/src/pages/Heightmap.vue b/src/pages/Heightmap.vue
index ad624fee..660a93bf 100644
--- a/src/pages/Heightmap.vue
+++ b/src/pages/Heightmap.vue
@@ -2,7 +2,7 @@
-
+
+ style="height: 400px; width: 100%; overflow: hidden" />
@@ -98,33 +98,33 @@
+ class="mt-0 ml-5" />
+ class="mx-3 mt-0" />
+ class="mx-3 mt-0" />
+ class="mx-3 mt-0" />
+ class="mx-3 mt-0" />
-
+
@@ -136,7 +136,7 @@
:step="0.1"
ticks="always"
class="mt-4"
- hide-details>
+ hide-details />
@@ -146,7 +146,7 @@
-
+
{{ $t('Heightmap.CurrentMesh.Size') }}
{{ currentProfile.data.x_count }}x{{ currentProfile.data.y_count }}
-
+
{{ $t('Heightmap.CurrentMesh.Max') }} [{{ bedMeshMaxPoint.positionX }},
@@ -176,7 +176,7 @@
{{ currentProfile.max.toFixed(3) }} mm
-
+
{{ $t('Heightmap.CurrentMesh.Min') }} [{{ bedMeshMinPoint.positionX }},
@@ -184,7 +184,7 @@
{{ currentProfile.min.toFixed(3) }} mm
-
+
{{ $t('Heightmap.CurrentMesh.Range') }}
{{ currentProfile.variance.toFixed(3) }} mm
@@ -192,14 +192,14 @@
-
+
@@ -299,7 +299,7 @@
@keyup.enter="renameProfile" />
-
+
{{ $t('Heightmap.Abort') }}
{{ $t('Heightmap.Rename') }}
@@ -313,7 +313,7 @@
:max-width="400"
@keydown.esc="calibrateDialog.boolShow = false">
@@ -337,7 +337,7 @@
@keyup.enter="calibrateMesh" />
-
+
{{ $t('Heightmap.Abort') }}
{{ $t('Heightmap.Calibrate') }}
@@ -347,7 +347,7 @@
@@ -360,7 +360,7 @@
{{ $t('Heightmap.DoYouReallyWantToDelete', { name: removeDialogProfile }) }}
-
+
{{ $t('Heightmap.Abort') }}
{{ $t('Heightmap.Remove') }}
@@ -368,7 +368,7 @@
@@ -381,7 +381,7 @@
{{ $t('Heightmap.RemoveSaveDescription') }}
-
+
{{ $t('Heightmap.Ok') }}
@@ -971,6 +971,24 @@ export default class PageHeightmap extends Mixins(BaseMixin, ControlMixin) {
return output
}
+ get probed_matrix() {
+ return this.bed_mesh.probed_matrix ?? [[]]
+ }
+
+ get bedMeshXLength() {
+ let x_length = this.probed_matrix[0].length - 1
+ if (x_length < 1) x_length = 1
+
+ return x_length
+ }
+
+ get bedMeshYLength() {
+ let y_length = this.probed_matrix.length - 1
+ if (y_length < 1) y_length = 1
+
+ return y_length
+ }
+
get bedMeshMaxPoint() {
if (this.bed_mesh.profile_name === '') return { row: 0, col: 0, positionX: 0, positionY: 0, value: 0 }
@@ -988,15 +1006,13 @@ export default class PageHeightmap extends Mixins(BaseMixin, ControlMixin) {
const positionX =
Math.round(
(this.bed_mesh.mesh_min[0] +
- ((this.bed_mesh.mesh_max[0] - this.bed_mesh.mesh_min[0]) / this.bed_mesh.probed_matrix[0].length) *
- (col - 1)) *
+ ((this.bed_mesh.mesh_max[0] - this.bed_mesh.mesh_min[0]) / this.bedMeshXLength) * (col - 1)) *
10
) / 10
const positionY =
Math.round(
(this.bed_mesh.mesh_min[1] +
- ((this.bed_mesh.mesh_max[1] - this.bed_mesh.mesh_min[1]) / this.bed_mesh.probed_matrix.length) *
- (row - 1)) *
+ ((this.bed_mesh.mesh_max[1] - this.bed_mesh.mesh_min[1]) / this.bedMeshYLength) * (row - 1)) *
10
) / 10
@@ -1026,15 +1042,13 @@ export default class PageHeightmap extends Mixins(BaseMixin, ControlMixin) {
const positionX =
Math.round(
(this.bed_mesh.mesh_min[0] +
- ((this.bed_mesh.mesh_max[0] - this.bed_mesh.mesh_min[0]) / this.bed_mesh.probed_matrix[0].length) *
- (col - 1)) *
+ ((this.bed_mesh.mesh_max[0] - this.bed_mesh.mesh_min[0]) / this.bedMeshXLength) * (col - 1)) *
10
) / 10
const positionY =
Math.round(
(this.bed_mesh.mesh_min[1] +
- ((this.bed_mesh.mesh_max[1] - this.bed_mesh.mesh_min[1]) / this.bed_mesh.probed_matrix.length) *
- (row - 1)) *
+ ((this.bed_mesh.mesh_max[1] - this.bed_mesh.mesh_min[1]) / this.bedMeshYLength) * (row - 1)) *
10
) / 10