Skip to content

Commit

Permalink
Fix atlas data not updating on draw mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans5958 committed Aug 4, 2023
1 parent 571adb1 commit 0829cdf
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions web/_js/main/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,18 @@ function initDraw() {

let highlightUncharted = highlightUnchartedEl.checked

renderBackground(atlasDisplay)
window.updateAtlas = updateAtlas

updateAtlas()

document.addEventListener('timeupdate', () => {
updateAtlas()
})

applyView()

container.style.cursor = "crosshair"

renderHighlight(path)

container.addEventListener("mousedown", e => {
lastPos = [
e.clientX,
Expand Down Expand Up @@ -557,6 +562,13 @@ function initDraw() {
updateCoordsDisplay(e)
}

function updateAtlas() {
;[atlas, atlasOrder] = filterAtlas(atlasAll)
;[atlasDisplay, atlasOrder] = generateAtlasDisplay(atlas, atlasOrder, currentPeriod, currentVariation)
renderBackground(atlasDisplay)
renderHighlight(atlasDisplay)
}

const getEntry = id => {
if (!id) return
return atlasAll[id]
Expand Down Expand Up @@ -814,7 +826,7 @@ function initDraw() {
)

document.addEventListener('timeupdate', () => {
renderBackground(atlas)
renderBackground(atlasDisplay)
updatePeriodGroups()
})

Expand Down

0 comments on commit 0829cdf

Please sign in to comment.