From a8843c453ccd53570e858b3cb683484772dad23f Mon Sep 17 00:00:00 2001 From: MeexReay Date: Fri, 23 May 2025 23:06:41 +0300 Subject: [PATCH] remove scroll while graphics are enabled --- sys/graphics.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/graphics.js b/sys/graphics.js index 53a30ca..091077f 100644 --- a/sys/graphics.js +++ b/sys/graphics.js @@ -3,6 +3,7 @@ var graphics_context = null function enableGraphics(options={}) { + document.body.style.overflow = "hidden" graphics_canvas = document.createElement("canvas") graphics_canvas.id = "graphics" graphics_canvas.width = window.innerWidth.toString() @@ -58,6 +59,7 @@ function getGraphics() { } function disableGraphics() { + document.body.style.overflow = null graphics_canvas.remove() graphics_canvas = null graphics_context = null