feat: add bed aspect ratio to heightmap graph (#1420)
Co-authored-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
parent
7468f882c1
commit
2b4b881c55
@ -629,6 +629,8 @@ export default class PageHeightmap extends Mixins(BaseMixin, ControlMixin) {
|
||||
},
|
||||
},
|
||||
},
|
||||
boxWidth: 100 * this.scaleX,
|
||||
boxDepth: 100 * this.scaleY,
|
||||
},
|
||||
series: this.series,
|
||||
}
|
||||
@ -699,6 +701,30 @@ export default class PageHeightmap extends Mixins(BaseMixin, ControlMixin) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'view.heightmap.scaleGradient', value: newVal })
|
||||
}
|
||||
|
||||
get absRangeX(): number {
|
||||
return this.rangeX[1] - this.rangeX[0]
|
||||
}
|
||||
|
||||
get absRangeY(): number {
|
||||
return this.rangeY[1] - this.rangeY[0]
|
||||
}
|
||||
|
||||
get minRangeXY(): number {
|
||||
return Math.min(this.absRangeX, this.absRangeY)
|
||||
}
|
||||
|
||||
get scaleX(): number {
|
||||
if (this.minRangeXY === 0) return 1
|
||||
|
||||
return this.absRangeX / this.minRangeXY
|
||||
}
|
||||
|
||||
get scaleY(): number {
|
||||
if (this.minRangeXY === 0) return 1
|
||||
|
||||
return this.absRangeY / this.minRangeXY
|
||||
}
|
||||
|
||||
get scaleZMax(): number {
|
||||
return this.$store.state.gui.view.heightmap.scaleZMax ?? 0.5
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user