mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-23 03:28:33 +00:00
fix hydra performance issues
This commit is contained in:
parent
b27f8e45dc
commit
de00212bb6
@ -4,11 +4,11 @@ export async function initHydra() {
|
|||||||
if (!document.getElementById('hydra-canvas')) {
|
if (!document.getElementById('hydra-canvas')) {
|
||||||
const { canvas: testCanvas } = getDrawContext();
|
const { canvas: testCanvas } = getDrawContext();
|
||||||
await import('https://unpkg.com/hydra-synth');
|
await import('https://unpkg.com/hydra-synth');
|
||||||
const hydraCanvas = testCanvas.cloneNode(true);
|
h = new Hydra({detectAudio: false });
|
||||||
hydraCanvas.id = 'hydra-canvas';
|
h.canvas.id = 'hydra-canvas';
|
||||||
testCanvas.after(hydraCanvas);
|
h.canvas.style.position = 'absolute';
|
||||||
new Hydra({ canvas: hydraCanvas, detectAudio: false });
|
h.canvas.style.top = '0px';
|
||||||
s0.init({ src: testCanvas });
|
testCanvas.after(h.canvas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user