fix synchronisation between users

This commit is contained in:
りき萌 2025-09-08 23:11:14 +02:00
parent 410f82201d
commit 85dce88ec2
4 changed files with 16 additions and 7 deletions

View file

@ -42,7 +42,7 @@ export class User {
return result;
}
simulate(chunkAllocator, wall, interactions) {
simulate(chunkAllocator, brushRenderer, wall, interactions) {
console.group("simulate", this.nickname);
for (let interaction of interactions) {
if (interaction.kind == "setBrush") {
@ -72,10 +72,16 @@ export class User {
if (interaction.kind == "scribble" && this.#expectContKind(ContKind.Scribble)) {
renderToChunksInArea(
chunkAllocator,
brushRenderer,
this.getScratchLayer(wall),
this.simulation.renderArea,
(pixmap, translationX, translationY) => {
return this.haku.contScribble(pixmap, translationX, translationY);
(brushRenderer, canvas, translationX, translationY) => {
return this.haku.contScribble(
brushRenderer,
canvas,
translationX,
translationY,
);
},
);
console.info("ended simulation");