fix minor bugs

This commit is contained in:
Felix Roos 2023-01-13 16:35:24 +01:00
parent 3744ea6218
commit 49bcb5e19f
5 changed files with 31 additions and 28 deletions

View file

@ -10,7 +10,7 @@ function usePatternFrame({ pattern, started, getTime, onDraw, drawTime = [-2, 2]
useEffect(() => {
if (pattern) {
const t = getTime();
const futureHaps = pattern.queryArc(t, t + lookahead + 0.1); // +0.1 = workaround for weird holes in query..
const futureHaps = pattern.queryArc(Math.max(t, 0), t + lookahead + 0.1); // +0.1 = workaround for weird holes in query..
visibleHaps.current = visibleHaps.current.filter((h) => h.whole.begin < t);
visibleHaps.current = visibleHaps.current.concat(futureHaps);
}