Fix text wrapping in button

This commit is contained in:
Dragon Fire
2020-05-23 12:12:20 -04:00
parent d4049d8da0
commit fc23466306
+2 -2
View File
@@ -58,7 +58,7 @@ module.exports = class TwoButtonsCommand extends Command {
ctx.rotate(-12 * (Math.PI / 180));
ctx.font = '50px Noto';
let fontSize = 50;
while (ctx.measureText(first).width > 183) {
while (ctx.measureText(first).width > 244) {
fontSize -= 1;
ctx.font = `${fontSize}px Noto`;
}
@@ -66,7 +66,7 @@ module.exports = class TwoButtonsCommand extends Command {
ctx.fillText(firstLines.join('\n'), 45, 178);
ctx.font = '50px Noto';
fontSize = 50;
while (ctx.measureText(second).width > 122) {
while (ctx.measureText(second).width > 163) {
fontSize -= 1;
ctx.font = `${fontSize}px Noto`;
}