|
|
@ -94,7 +94,13 @@ export class Batch {
|
|
|
|
this.render_effects = [];
|
|
|
|
this.render_effects = [];
|
|
|
|
this.effects = [];
|
|
|
|
this.effects = [];
|
|
|
|
|
|
|
|
|
|
|
|
this.commit();
|
|
|
|
// commit changes
|
|
|
|
|
|
|
|
for (const fn of this.#callbacks) {
|
|
|
|
|
|
|
|
fn();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.#callbacks.clear();
|
|
|
|
|
|
|
|
|
|
|
|
flush_queued_effects(render_effects);
|
|
|
|
flush_queued_effects(render_effects);
|
|
|
|
flush_queued_effects(effects);
|
|
|
|
flush_queued_effects(effects);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -173,14 +179,6 @@ export class Batch {
|
|
|
|
this.#callbacks.add(fn);
|
|
|
|
this.#callbacks.add(fn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
commit() {
|
|
|
|
|
|
|
|
for (const fn of this.#callbacks) {
|
|
|
|
|
|
|
|
fn();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.#callbacks.clear();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static ensure() {
|
|
|
|
static ensure() {
|
|
|
|
if (current_batch === null) {
|
|
|
|
if (current_batch === null) {
|
|
|
|
if (batches.size === 0) {
|
|
|
|
if (batches.size === 0) {
|
|
|
|