mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-26 04:58:27 +00:00
fix: do not recreate haps mapping on update
This commit is contained in:
parent
78770888a5
commit
3fc5bb31d0
@ -98,18 +98,17 @@ const visibleMiniLocations = StateField.define({
|
|||||||
// this is called every frame to show the locations that are currently active
|
// this is called every frame to show the locations that are currently active
|
||||||
// we can NOT create new marks because the context.locations haven't changed since eval time
|
// we can NOT create new marks because the context.locations haven't changed since eval time
|
||||||
// this is why we need to find a way to update the existing decorations, showing the ones that have an active range
|
// this is why we need to find a way to update the existing decorations, showing the ones that have an active range
|
||||||
const haps = new Map();
|
|
||||||
|
|
||||||
for (let hap of e.value.haps) {
|
for (let hap of e.value.haps) {
|
||||||
for (let { start, end } of hap.context.locations) {
|
for (let { start, end } of hap.context.locations) {
|
||||||
let id = `${start}:${end}`;
|
let id = `${start}:${end}`;
|
||||||
if (!haps.has(id) || haps.get(id).whole.begin.lt(hap.whole.begin)) {
|
if (!visible.haps.has(id) || visible.haps.get(id).whole.begin.lt(hap.whole.begin)) {
|
||||||
haps.set(id, hap);
|
visible.haps.set(id, hap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
visible = { atTime: e.value.atTime, haps };
|
visible = { atTime: e.value.atTime, haps: visible.haps };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user