Skip to content

Commit

Permalink
Render bounding box in dev-mode when nocrop is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
zk-phi committed Sep 25, 2024
1 parent 990202d commit f68d58e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/utils/emoji.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@ function renderFrameUncut(
}

if (noCrop) {
// copy webgl canvas with background to a 2d canvas
return cropCanvas(canvas, 0, 0, targetWidth * 2, targetHeight * 2, fillStyle);
// copy webgl canvas to a 2d canvas, with background
const result = cropCanvas(canvas, 0, 0, targetWidth * 2, targetHeight * 2, fillStyle);
const ctx = result.getContext("2d")!;

Check failure on line 77 in src/utils/emoji.ts

View workflow job for this annotation

GitHub Actions / lint-js

'ctx' is already declared in the upper scope on line 30 column 9
ctx.rect(targetWidth / 2, targetHeight / 2, targetWidth, targetHeight);
ctx.strokeStyle = "#8888";
ctx.stroke();
return result;
} else {
return cropCanvas(
canvas,
Expand Down

0 comments on commit f68d58e

Please sign in to comment.