add resizing graphics canvas on onresize event

This commit is contained in:
MeexReay 2025-05-23 19:15:31 +03:00
parent 2e0faa5d8c
commit 5c17c8908d

View File

@ -41,6 +41,12 @@ function enableGraphics(options={}) {
graphics_context = graphics_canvas.getContext("2d") graphics_context = graphics_canvas.getContext("2d")
graphics_context.fillStyle = "black"; graphics_context.fillStyle = "black";
graphics_context.fillRect(0, 0, graphics_canvas.width, graphics_canvas.height); graphics_context.fillRect(0, 0, graphics_canvas.width, graphics_canvas.height);
window.addEventListener("resize", (event) => {
graphics_canvas.width = window.innerWidth.toString()
graphics_canvas.height = window.innerHeight.toString()
})
document.body.appendChild(graphics_canvas) document.body.appendChild(graphics_canvas)
} }
@ -87,4 +93,4 @@ function getWindow(wid) {
function listWindows() { function listWindows() {
writeStdout("НА ВАШЕМ устройстве не найдена ни одна имплементация ZCOM. Установите чонить такое, по типу mxwm да есть же броу\n") writeStdout("НА ВАШЕМ устройстве не найдена ни одна имплементация ZCOM. Установите чонить такое, по типу mxwm да есть же броу\n")
throw new Error("There is no zcom implementation") throw new Error("There is no zcom implementation")
} }