Skip to content

Commit

Permalink
Remove useless canvas data refetch
Browse files Browse the repository at this point in the history
  • Loading branch information
Bios-Marcel committed Oct 27, 2024
1 parent f3728fe commit 444650d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/frontend/templates/lobby.html
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,6 @@
function applyDrawData(drawElements) {
clear(context);
const scaleFactor = scaleDownFactor();
imageData = context.getImageData(0, 0, context.canvas.width, context.canvas.height);

// This implementation directly access the canvas data and does not
// put it back into the canvas context directly. This saved us not
Expand Down Expand Up @@ -1967,6 +1966,7 @@
function clear(context) {
context.fillStyle = "#FFFFFF";
context.fillRect(0, 0, drawingBoard.width, drawingBoard.height);
// Refetch, as we don't manually fill here.
imageData = context.getImageData(0, 0, context.canvas.width, context.canvas.height);
}

Expand Down

0 comments on commit 444650d

Please sign in to comment.