bugfix(heightmap): fixed profiles list for KevinOConnor/klipper#4598

Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Stefan Dej 2021-08-21 18:05:24 +02:00
parent 94d445c9fe
commit ef9b17a9f4

View File

@ -529,7 +529,8 @@ export const getters: GetterTree<PrinterState, RootState> = {
const value: any = state.configfile.settings[key.toLowerCase()]
const nameSplit = key.split(" ")
const points: number[] = []
let points: number[] = []
if (typeof value.points === "string") {
value.points.split("\n").forEach((row: string) => {
if (row !== "") {
row.split(', ').forEach((col: string) => {
@ -537,6 +538,11 @@ export const getters: GetterTree<PrinterState, RootState> = {
})
}
})
} else {
value.points.forEach((row: number[]) => {
points = points.concat(row)
})
}
const min = Math.min(...points)
const max = Math.max(...points)