diff --git a/data/emulator.js b/data/emulator.js index 1ac4c8f..03fb8df 100644 --- a/data/emulator.js +++ b/data/emulator.js @@ -1620,8 +1620,6 @@ class EmulatorJS { return both ? [button, svg, text] : button; } - //todo. Center text on not restart button - const restartButton = addButton("Restart", '', () => { if (this.isNetplay && this.netplay.owner) { this.gameManager.saveSaveFiles(); @@ -3846,17 +3844,19 @@ class EmulatorJS { this.settingsMenu.style.display = ""; needChange = true; } - const x = this.settingsMenu.parentElement.getBoundingClientRect().x; let height = this.elements.parent.getBoundingClientRect().height; - let width = this.elements.parent.getBoundingClientRect().width; + let w2 = this.settingParent.parentElement.getBoundingClientRect().width; + let settingsX = this.settingParent.getBoundingClientRect().x; + if (w2 > window.innerWidth) settingsX += (w2 - window.innerWidth); + const onTheRight = settingsX > (w2-15)/2; if (height > 375) height = 375; home.style['max-height'] = (height - 95) + "px"; nested.style['max-height'] = (height - 95) + "px"; for (let i=0; i= width/2) && (width < 575)); + this.settingsMenu.classList.toggle("ejs_settings_center_left", !onTheRight); + this.settingsMenu.classList.toggle("ejs_settings_center_right", onTheRight); if (needChange) { this.settingsMenu.style.display = "none"; this.settingsMenu.style.opacity = "";