First attempt at responsive support for the display
NOTE: Resize is not yet supported
This commit is contained in:
parent
a874b2a332
commit
f3cf5750ab
@ -268,7 +268,16 @@
|
|||||||
const display = document.getElementById("display");
|
const display = document.getElementById("display");
|
||||||
if(display)
|
if(display)
|
||||||
{
|
{
|
||||||
cx.setKmsCanvas(display, display.offsetWidth, display.offsetHeight);
|
var mult = 1.0;
|
||||||
|
var displayWidth = display.offsetWidth;
|
||||||
|
var displayHeight = display.offsetHeight;
|
||||||
|
var minWidth = 1024;
|
||||||
|
var minHeight = 768;
|
||||||
|
if(displayWidth < minWidth)
|
||||||
|
mult = minWidth / displayWidth;
|
||||||
|
if(displayHeight < minHeight)
|
||||||
|
mult = Math.max(mult, minHeight / displayHeight);
|
||||||
|
cx.setKmsCanvas(display, displayWidth * mult, displayHeight * mult);
|
||||||
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user