From 63928a3968efaf552fd10594ed71d94dd0bc2423 Mon Sep 17 00:00:00 2001 From: Spencer Brown Date: Tue, 21 Nov 2023 11:34:57 +1000 Subject: [PATCH] Fix scrolling in error display view --- error_display/static/script.js | 14 ++++++++------ error_display/static/styles.css | 1 - 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/error_display/static/script.js b/error_display/static/script.js index d3d6ab210..002dbcbac 100644 --- a/error_display/static/script.js +++ b/error_display/static/script.js @@ -216,20 +216,22 @@ window.addEventListener("load", () => { .then(updateScene) .catch((reason) => { console.error(reason); - content_box.innerText = 'Could not fetch display: ' + reason; + container.innerText = 'Could not fetch display: ' + reason; }); - // Lock the article to use multiples of the tile size. const update = () => { const screen_width = document.documentElement.clientWidth - PADDING; const screen_height = document.documentElement.clientHeight - PADDING; - const box_height = Math.floor(screen_height / TILE_SIZE) * TILE_SIZE; + let height = Math.floor(screen_height / TILE_SIZE); + if (height > 8) { + height = 8; + } + height *= TILE_SIZE; - content_box.style.width = `${Math.floor(screen_width / TILE_SIZE) * TILE_SIZE}px`; - content_box.style.height = `${box_height}px`; + container.style.width = `${Math.floor(screen_width / TILE_SIZE) * TILE_SIZE}px`; + container.style.height = `${height}px`; const render_bbox = container.getBoundingClientRect(); - const height = box_height - render_bbox.y + 16; camera.aspect = render_bbox.width / height; camera.updateProjectionMatrix(); renderer.setSize( render_bbox.width, height ); diff --git a/error_display/static/styles.css b/error_display/static/styles.css index 6976601dd..aa74bbfad 100644 --- a/error_display/static/styles.css +++ b/error_display/static/styles.css @@ -23,7 +23,6 @@ main { background-origin: border-box; background-repeat: repeat; color: rgb(201, 211, 207); - overflow-y: scroll; /* Compile dialog uses FriendsListStatusLine: Univers Std Condensed, weight=&00, tall=14 */