Use const

This commit is contained in:
Hans5958 2022-04-23 20:29:22 +07:00
parent 02a6ad3499
commit 8764f8e985
2 changed files with 4 additions and 4 deletions

View file

@ -487,7 +487,7 @@ function initDraw() {
}
function calculateCenter(path) {
let result = polylabel(path)
const result = polylabel(path)
return [Math.floor(result[0]) + 0.5, Math.floor(result[1]) + 0.5]
}

View file

@ -180,7 +180,7 @@ async function updateTime(newPeriod = currentPeriod, newVariation = currentVaria
atlas = []
for (const atlasIndex in atlasAll) {
let pathChosen, centerChosen, chosenIndex
let chosenIndex
const validPeriods2 = Object.keys(atlasAll[atlasIndex].path)
@ -197,8 +197,8 @@ async function updateTime(newPeriod = currentPeriod, newVariation = currentVaria
}
if (chosenIndex === undefined) continue
pathChosen = Object.values(atlasAll[atlasIndex].path)[chosenIndex]
centerChosen = Object.values(atlasAll[atlasIndex].center)[chosenIndex]
const pathChosen = Object.values(atlasAll[atlasIndex].path)[chosenIndex]
const centerChosen = Object.values(atlasAll[atlasIndex].center)[chosenIndex]
if (pathChosen === undefined) continue