fix getterminalsize

This commit is contained in:
MeexReay 2025-03-21 18:11:48 +03:00
parent 4109fbd0e0
commit beb6220348
2 changed files with 4 additions and 4 deletions

View File

@ -22,9 +22,9 @@ async function main(args) {
break
}
writeStdout(event.key + "\n")
writeStdout(event + "\n")
} else if (event.type == "char") {
writeStdout(event.char + "\n")
writeStdout(event + "\n")
}
}

View File

@ -7,8 +7,8 @@ var last_stdin_length = 0
function getTerminalSize() {
return [
Math.floor(window.innerWidth - CURSOR_OFFSET[0] * 2 / CHAR_SIZE[0]),
Math.floor(window.innerHeight - CURSOR_OFFSET[1] * 2 / CHAR_SIZE[1])
Math.floor((window.innerWidth - CURSOR_OFFSET[0] * 2) / CHAR_SIZE[0]),
Math.floor((window.innerHeight - CURSOR_OFFSET[1] * 2) / CHAR_SIZE[1])
]
}