mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 05:51:42 +02:00
Fix lint
This commit is contained in:
@@ -50,19 +50,18 @@ module.exports = class DemotivationalPosterCommand extends Command {
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
let width = data.width;
|
||||
let height = data.height;
|
||||
let { width, height } = data;
|
||||
const maxWidth = 602;
|
||||
if (width > maxWidth) {
|
||||
const ratio = maxWidth / width;
|
||||
width = maxWidth;
|
||||
height = height * ratio;
|
||||
height *= ratio;
|
||||
}
|
||||
const maxHeight = 402;
|
||||
if (height > maxHeight) {
|
||||
const ratio = maxHeight / height;
|
||||
height = maxHeight;
|
||||
width = width * ratio;
|
||||
width *= ratio;
|
||||
}
|
||||
const x = (canvas.width / 2) - (width / 2);
|
||||
const y = 44 + ((402 / 2) - (height / 2));
|
||||
|
||||
Reference in New Issue
Block a user