diff options
| author | LLLL Colonq <llll@colonq> | 2025-02-18 02:16:42 -0500 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2025-02-18 02:16:42 -0500 |
| commit | 34b49df0ab7336789e79590e51d4456f92024408 (patch) | |
| tree | afb48cf4b8225f4aad720625e25ddbb02faec462 | |
| parent | 40e23e661765c9eae506efc3308be1b053deda4a (diff) | |
Fix aspect ratio
| -rw-r--r-- | flake.lock | 8 | ||||
| -rw-r--r-- | templates/api/throwshade.html | 18 |
2 files changed, 18 insertions, 8 deletions
@@ -172,11 +172,11 @@ "st": "st" }, "locked": { - "lastModified": 1739851074, - "narHash": "sha256-Bx2LdbFBfGX+CpBGTbBRHXfbxBbF8L9aERZfal7jBDU=", + "lastModified": 1739859479, + "narHash": "sha256-N7dCjxO2z688JivQHOVQ79zEKdBPgIcy68V8BJ/mReI=", "ref": "refs/heads/master", - "rev": "0a078977d4b033739e85b95942a3f02711c4b9a3", - "revCount": 17, + "rev": "cc3e4cbcb484c6aff6fae5124b2400346bb64c95", + "revCount": 18, "type": "git", "url": "ssh://git@github.com/lcolonq/newton" }, diff --git a/templates/api/throwshade.html b/templates/api/throwshade.html index 2bf006a..d65add6 100644 --- a/templates/api/throwshade.html +++ b/templates/api/throwshade.html @@ -16,6 +16,16 @@ CONFIG_SUBST window.wasmBindings = bindings; console.log("initialized, starting..."); window.wasmBindings.main_js(); + function resizeCanvas() { + let canvas = document.getElementById("teleia-parent").firstChild; + if (canvas) { + canvas.width = 1920; + canvas.height = 1080; + } else { + setTimeout(resizeCanvas, 50); + } + } + resizeCanvas(); </script> <script type="module" src="./main.js"></script> </head> @@ -24,10 +34,10 @@ CONFIG_SUBST <div id="lcolonq-throwshade-bottom"> <div id="lcolonq-throwshade-bottom-left"> <textarea id="lcolonq-throwshade-textarea"> -vec4 shade(vec2 cs) { - return vec4(0.0, 1.0, 0.0, 1.0); -} -</textarea> + vec4 shade(vec2 cs) { + return vec4(0.0, 1.0, 0.0, 1.0); + } + </textarea> </div> <div id="lcolonq-throwshade-bottom-right"> <img id="lcolonq-throwshade-button-test" src="./assets/test.gif"></img> |
