proper draw cleanup
This commit is contained in:
parent
aa76419eda
commit
8f31fbe275
5 changed files with 157 additions and 154 deletions
|
|
@ -114,6 +114,10 @@ function App() {
|
|||
defaultOutput: webaudioOutput,
|
||||
getTime,
|
||||
autolink: true,
|
||||
beforeEval: () => {
|
||||
cleanupUi();
|
||||
cleanupDraw();
|
||||
},
|
||||
});
|
||||
|
||||
// init code
|
||||
|
|
@ -175,7 +179,6 @@ function App() {
|
|||
} else {
|
||||
logger('[repl] stopped. tip: you can also stop by pressing ctrl+dot', 'highlight');
|
||||
stop();
|
||||
// cleanupDraw();
|
||||
}
|
||||
};
|
||||
const handleUpdate = () => {
|
||||
|
|
@ -186,9 +189,6 @@ function App() {
|
|||
const handleShuffle = async () => {
|
||||
const { code, name } = getRandomTune();
|
||||
logger(`[repl] ✨ loading random tune "${name}"`);
|
||||
|
||||
cleanupDraw();
|
||||
cleanupUi();
|
||||
resetLoadedSamples();
|
||||
await prebake(); // declare default samples
|
||||
await evaluate(code, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue