diff --git a/src/pages/Heightmap.vue b/src/pages/Heightmap.vue index 39f592f0..fbda43c3 100644 --- a/src/pages/Heightmap.vue +++ b/src/pages/Heightmap.vue @@ -443,6 +443,21 @@ export default class PageHeightmap extends Mixins(BaseMixin) { return [min, max] } + get probedHeightmapLimit(): number[] { + let min = 0 + let max = 0 + + if (this.bed_mesh) { + const points = [] + for (const row of this.bed_mesh.probed_matrix) for (const col of row) points.push(col) + + min = Math.min(min, ...points) + max = Math.max(max, ...points) + } + + return [min, max] + } + get heightmapRangeLimit(): number[] { const [min, max] = this.heightmapLimit @@ -655,7 +670,7 @@ export default class PageHeightmap extends Mixins(BaseMixin) { get bedMeshMaxPoint() { if (this.bed_mesh.profile_name === '') return { row: 0, col: 0, positionX: 0, positionY: 0, value: 0 } - const [ , max] = this.heightmapLimit + const [ , max] = this.probedHeightmapLimit let row = 0 let col = 0 @@ -681,7 +696,7 @@ export default class PageHeightmap extends Mixins(BaseMixin) { get bedMeshMinPoint() { if (this.bed_mesh.profile_name === '') return { row: 0, col: 0, positionX: 0, positionY: 0, value: 0 } - const [min, ] = this.heightmapLimit + const [min, ] = this.probedHeightmapLimit let row = 0 let col = 0