mirror of
https://github.com/MeexReay/poshlostios.git
synced 2025-06-24 02:22:58 +03:00
add resizing graphics canvas on onresize event
This commit is contained in:
parent
2e0faa5d8c
commit
5c17c8908d
@ -41,6 +41,12 @@ function enableGraphics(options={}) {
|
||||
graphics_context = graphics_canvas.getContext("2d")
|
||||
graphics_context.fillStyle = "black";
|
||||
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)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user