Skip to content

Commit

Permalink
SW-3291 Add log messages on draw and clear canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledsherkawi committed Sep 19, 2023
1 parent d3a2c2b commit fb668f5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions octoprint_mrbeam/static/js/app/helpers/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,13 @@ $(function () {
return new Promise((resolve) => {
if (includesQuickText) {
setTimeout(() => {
// Log image dimensions
console.info(
`Clear canvas: x=${x}, y=${y}, canvas.width=${updatedCanvas.canvas.width}, canvas.height=${updatedCanvas.canvas.height}`
);
updatedCanvas.ctx.clearRect(
0,
0,
x,
y,
updatedCanvas.canvas.width,
updatedCanvas.canvas.height
);
Expand Down Expand Up @@ -189,7 +193,7 @@ $(function () {
}

// Log image dimensions
console.info(`c.drawImage ${x}, ${y}, ${w}, ${h}`);
console.info(`Draw image: x=${x}, y=${y}, w=${w}, h=${h}`);

// Draw image on canvas
ctx.drawImage(image, x, y, w, h, 0, 0, canvas.width, canvas.height);
Expand Down

0 comments on commit fb668f5

Please sign in to comment.