mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2026-02-06 11:17:36 +00:00
Add sizes to parent element
This commit is contained in:
parent
c7d6a49fdb
commit
f679b265e9
@ -221,6 +221,11 @@
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ejs_canvas_parent {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ejs_context_menu {
|
||||
position: absolute;
|
||||
display: none;
|
||||
|
||||
@ -1006,6 +1006,7 @@ class EmulatorJS {
|
||||
this.textElem.remove();
|
||||
this.textElem = null;
|
||||
this.game.classList.remove("ejs_game");
|
||||
this.game.classList.add("ejs_canvas_parent");
|
||||
this.game.appendChild(this.canvas);
|
||||
this.handleResize();
|
||||
this.started = true;
|
||||
@ -4109,14 +4110,6 @@ class EmulatorJS {
|
||||
//This wouldnt work using :not()... strange.
|
||||
this.game.parentElement.classList.toggle("ejs_big_screen", positionInfo.width > 575);
|
||||
|
||||
if (!this.Module) return;
|
||||
const dpr = 1; //window.devicePixelRatio || 1;
|
||||
const width = positionInfo.width * dpr;
|
||||
const height = (positionInfo.height * dpr);
|
||||
this.Module.canvas.style.width = width;
|
||||
this.Module.canvas.style.height = height;
|
||||
//this.Module.setCanvasSize(width, height);
|
||||
|
||||
if (!this.handleSettingsResize) return;
|
||||
this.handleSettingsResize();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user