From a2577ba2f542cc029db5ad063616f30a38f66894 Mon Sep 17 00:00:00 2001 From: MajesticWafer <123651667+MajesticWafer@users.noreply.github.com> Date: Thu, 19 Oct 2023 15:22:45 -0400 Subject: [PATCH] Update app.js --- app.js | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/app.js b/app.js index b2dc519..805e140 100644 --- a/app.js +++ b/app.js @@ -387,25 +387,30 @@ function uiAdjustVKLayout() { } function uiUpdateLayout() { - isLandscape = window.innerWidth > window.innerHeight - var maxWidth = window.innerWidth - var maxHeight = window.innerHeight / 2 - var w = maxWidth - var h = w / 256 * 192 - if (h > maxHeight) { - h = maxHeight - w = h / 192 * 256 - } - var left = 0 - left += (window.innerWidth - w) / 2; - var top = 0 - - fbSize = [[w, h], [w, h]] - for (var i = 0; i < 2; i++) { - screenCanvas[i].style = 'left:' + left + 'px;top:' + top + "px;width:" + w + "px;height:" + h + "px;" - top += h - } - uiAdjustVKLayout() + isLandscape = window.innerWidth > window.innerHeight; + var maxWidth = window.innerWidth; + var maxHeight = window.innerHeight / 2; + var w, h, left, top; + + if (screenLayout === 'lbr') { + w = maxWidth; + h = maxHeight; + left = 0; + top = 0; + } else { + w = 256; + h = 192; + left = (window.innerWidth - w) / 2; + top = 0; + } + + fbSize = [[w, h], [w, h]]; + for (var i = 0; i < 2; i++) { + screenCanvas[i].style = 'left:' + left + 'px;top:' + top + 'px;width:' + w + 'px;height:' + h + 'px;'; + top += h; + } + + uiAdjustVKLayout(); }