Fixes for scaling
This commit is contained in:
parent
ac42423e5f
commit
ae30357f0e
20
app/ui.js
20
app/ui.js
|
@ -1900,10 +1900,10 @@ const UI = {
|
|||
}
|
||||
monitors.push({
|
||||
id: screen.screenID,
|
||||
x: Math.round(screen.x / scale),
|
||||
y: Math.round(screen.y / scale),
|
||||
w: Math.round(screen.serverWidth / scale),
|
||||
h: Math.round(screen.serverHeight / scale),
|
||||
x: screen.x / scale,
|
||||
y: screen.y / scale,
|
||||
w: screen.serverWidth / scale,
|
||||
h: screen.serverHeight / scale,
|
||||
pixelRatio: screen.pixelRatio,
|
||||
scale: 1,
|
||||
fill: '#eeeeeecc',
|
||||
|
@ -2059,15 +2059,15 @@ const UI = {
|
|||
console.log(a)
|
||||
screens.push({
|
||||
screenID: a.id,
|
||||
serverHeight: Math.floor(a.h * scale),
|
||||
serverWidth: Math.floor(a.w * scale),
|
||||
x: Math.floor((a.x - left) * scale),
|
||||
y: Math.floor((a.y - top) * scale)
|
||||
serverHeight: Math.round(a.h * scale),
|
||||
serverWidth: Math.round(a.w * scale),
|
||||
x: Math.round((a.x - left) * scale),
|
||||
y: Math.round((a.y - top) * scale)
|
||||
})
|
||||
}
|
||||
const screenPlan = {
|
||||
serverHeight: Math.floor(height * scale),
|
||||
serverWidth: Math.floor(width * scale),
|
||||
serverHeight: Math.round(height * scale),
|
||||
serverWidth: Math.round(width * scale),
|
||||
screens
|
||||
}
|
||||
console.log('setScreenPlan')
|
||||
|
|
|
@ -13,13 +13,13 @@ const UI = {
|
|||
controlChannel: null,
|
||||
//Initial Loading of the UI
|
||||
prime() {
|
||||
this.start();
|
||||
console.log('prime')
|
||||
this.start();
|
||||
},
|
||||
|
||||
//Render default UI
|
||||
start() {
|
||||
console.log('prime')
|
||||
console.log('start')
|
||||
window.addEventListener("beforeunload", (e) => {
|
||||
if (UI.rfb) {
|
||||
UI.disconnect();
|
||||
|
@ -271,7 +271,7 @@ const UI = {
|
|||
if (UI.rfb) {
|
||||
UI.rfb.disconnect();
|
||||
if (UI.supportsBroadcastChannel) {
|
||||
console.log('remove')
|
||||
console.log('remove event listeners')
|
||||
UI.controlChannel.removeEventListener('message', UI.handleControlMessage);
|
||||
UI.rfb.removeEventListener("connect", UI.connectFinished);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue