Skip to content

Commit

Permalink
Fix scrolling in error display view
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSpen210 committed Nov 21, 2023
1 parent 2202456 commit 63928a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 8 additions & 6 deletions error_display/static/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
1 change: 0 additions & 1 deletion error_display/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 63928a3

Please sign in to comment.