From 7abab6a0017dba2a89f7228117c9ddd0d51ce220 Mon Sep 17 00:00:00 2001 From: Mari Date: Sat, 4 May 2024 00:57:48 -0700 Subject: [PATCH] avoid half pixels --- src/commands/base.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/base.ts b/src/commands/base.ts index 69f16ca..ee4c86f 100644 --- a/src/commands/base.ts +++ b/src/commands/base.ts @@ -313,7 +313,7 @@ export abstract class AbstractCharacterStatusCommand extends SlashCommand { const height = metadatas[i].height ?? NORMAL_STATUS_HEIGHT; maxWidth[polarity] = Math.max(maxWidth[polarity], width); lastHeight[polarity] = height; - const top = Math.max(totalHeight[polarity], totalHeight[reversePolarity] - lastHeight[reversePolarity] / 2); + const top = Math.max(totalHeight[polarity], totalHeight[reversePolarity] - Math.ceil(lastHeight[reversePolarity] / 2)); topCoordinates[i] = top; totalHeight[polarity] = top + height; } @@ -324,7 +324,7 @@ export abstract class AbstractCharacterStatusCommand extends SlashCommand { background: '#00000000', channels: 4, height: Math.max(totalHeight[0], totalHeight[1]), - width: maxWidth[0] + maxWidth[1] + width: maxWidth[0] + maxWidth[1], } }); result.composite(