menu: Prefer left alignment for titles which are not divisible by 2

This commit is contained in:
mintsuki 2021-07-07 02:43:07 +02:00
parent 3ba705d082
commit 177b83de9c
2 changed files with 10 additions and 10 deletions

View File

@ -188,7 +188,7 @@ refresh:
// FALLTHRU
default: {
int title_length = strlen(title);
if (i == (term_cols / 2) - (title_length / 2) - 1) {
if (i == (term_cols / 2) - DIV_ROUNDUP(title_length, 2)) {
print("%s", title);
i += title_length - 1;
} else {

View File

@ -1,6 +1,6 @@
DEFAULT_ENTRY=1
TIMEOUT=3
GRAPHICS=yes
#GRAPHICS=yes
MENU_FONT=boot:///boot/font.bin
VERBOSE=yes