Skip to content

Commit

Permalink
Update app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
MajesticWafer authored Oct 19, 2023
1 parent 31d78c6 commit 27cc892
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,32 +387,28 @@ function uiAdjustVKLayout() {
}

function uiUpdateLayout() {
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 = (maxHeight - h) / 2;
}

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 = 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()
}


function uiSwitchTo(mode) {
if (mode == uiCurrentMode) {
return
Expand Down Expand Up @@ -859,4 +855,3 @@ function enableMicrophone() {

});
}

0 comments on commit 27cc892

Please sign in to comment.