Skip to content

Commit 5cfc81d

Browse files
authored
Merge pull request #48 from acmucsd/asform-qr
Get rid of excess border when using original one-QR code checkin
2 parents 00b83d6 + 4e2366a commit 5cfc81d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/commands/Checkin.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,14 @@ export default class Checkin extends Command {
273273
// Importing DM Sans as our font
274274
registerFont('./src/assets/DMSans-Bold.ttf', { family: 'DM Sans' });
275275

276-
// Creating slide with Canvas
277-
// Helpful resource: https://blog.logrocket.com/creating-saving-images-node-canvas/
278-
const slide = createCanvas(1920, 1280);
279-
const context = slide.getContext('2d');
280-
context.fillRect(0, 0, 1920, 1280);
281-
282276
// AS attendance form and ACM portal checkin both needed — use dual layout
283277
if (typeof asFormQrCode !== 'undefined' && asFormQrCode) {
278+
// Creating slide with Canvas
279+
// Helpful resource: https://blog.logrocket.com/creating-saving-images-node-canvas/
280+
const slide = createCanvas(1920, 1280);
281+
const context = slide.getContext('2d');
282+
context.fillRect(0, 0, 1920, 1280);
283+
284284
// Draw background
285285
const background = await loadImage('./src/assets/dual-qr-slide-background.png');
286286
context.drawImage(background, 0, 0, 1920, 1280);
@@ -338,6 +338,10 @@ export default class Checkin extends Command {
338338
}
339339
// Only ACM portal checkin needed
340340

341+
const slide = createCanvas(1920, 1080);
342+
const context = slide.getContext('2d');
343+
context.fillRect(0, 0, 1920, 1080);
344+
341345
// Draw background
342346
const background = await loadImage('./src/assets/qr-slide-background.png');
343347
context.drawImage(background, 0, 0, 1920, 1080);

0 commit comments

Comments
 (0)