Make the canvas display fill up the screen

This commit is contained in:
Alessandro Pignotti 2024-10-18 13:02:11 +02:00
parent 7bf9990995
commit 310a9ce2e2

View File

@ -187,7 +187,7 @@
return; return;
// Raise the display to the foreground // Raise the display to the foreground
const display = document.getElementById("display"); const display = document.getElementById("display");
display.style.zIndex = 5; display.parentElement.style.zIndex = 5;
plausible("Display activated"); plausible("Display activated");
} }
function handleProcessCreated() function handleProcessCreated()
@ -268,7 +268,7 @@
const display = document.getElementById("display"); const display = document.getElementById("display");
if(display) if(display)
{ {
cx.setKmsCanvas(display, 1024, 768); cx.setKmsCanvas(display, display.offsetWidth, display.offsetHeight);
cx.setActivateConsole(handleActivateConsole); cx.setActivateConsole(handleActivateConsole);
} }
// Run the command in a loop, in case the user exits // Run the command in a loop, in case the user exits
@ -299,7 +299,9 @@
<div class="absolute top-10 bottom-0 left-0 right-0"> <div class="absolute top-10 bottom-0 left-0 right-0">
<SideBar on:connect={handleConnect} on:reset={handleReset}/> <SideBar on:connect={handleConnect} on:reset={handleReset}/>
{#if configObj.needsDisplay} {#if configObj.needsDisplay}
<canvas class="absolute top-0 bottom-0 left-14 right-0" width="1024" height="768" id="display"></canvas> <div class="absolute top-0 bottom-0 left-14 right-0">
<canvas class="w-full h-full" id="display"></canvas>
</div>
{/if} {/if}
<div class="absolute top-0 bottom-0 left-14 right-0 p-1 scrollbar" id="console"> <div class="absolute top-0 bottom-0 left-14 right-0 p-1 scrollbar" id="console">
</div> </div>