fix secondary resize, fix small screens auto pixel ratio
This commit is contained in:
parent
2b7f938c6e
commit
66355143a9
|
@ -27,6 +27,9 @@ const UI = {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Settings with immediate effects
|
||||||
|
UI.initSetting('logging', 'warn');
|
||||||
|
UI.updateLogging();
|
||||||
|
|
||||||
UI.addDefaultHandlers();
|
UI.addDefaultHandlers();
|
||||||
UI.updateVisualState('disconnected');
|
UI.updateVisualState('disconnected');
|
||||||
|
@ -66,8 +69,8 @@ const UI = {
|
||||||
UI.rfb.addEventListener("connect", UI.connectFinished);
|
UI.rfb.addEventListener("connect", UI.connectFinished);
|
||||||
//UI.rfb.addEventListener("disconnect", UI.disconnectFinished);
|
//UI.rfb.addEventListener("disconnect", UI.disconnectFinished);
|
||||||
UI.rfb.clipViewport = UI.getSetting('view_clip');
|
UI.rfb.clipViewport = UI.getSetting('view_clip');
|
||||||
UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale';
|
UI.rfb.scaleViewport = UI.getSetting('resize', false, 'remote') === 'scale';
|
||||||
UI.rfb.resizeSession = UI.getSetting('resize') === 'remote';
|
UI.rfb.resizeSession = UI.getSetting('resize', false, 'remote') === 'remote';
|
||||||
UI.rfb.qualityLevel = parseInt(UI.getSetting('quality'));
|
UI.rfb.qualityLevel = parseInt(UI.getSetting('quality'));
|
||||||
UI.rfb.dynamicQualityMin = parseInt(UI.getSetting('dynamic_quality_min'));
|
UI.rfb.dynamicQualityMin = parseInt(UI.getSetting('dynamic_quality_min'));
|
||||||
UI.rfb.dynamicQualityMax = parseInt(UI.getSetting('dynamic_quality_max'));
|
UI.rfb.dynamicQualityMax = parseInt(UI.getSetting('dynamic_quality_max'));
|
||||||
|
@ -307,6 +310,22 @@ const UI = {
|
||||||
|
|
||||||
return mouseButtonMapper;
|
return mouseButtonMapper;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateLogging() {
|
||||||
|
WebUtil.initLogging(UI.getSetting('logging'));
|
||||||
|
},
|
||||||
|
|
||||||
|
// Initial page load read/initialization of settings
|
||||||
|
initSetting(name, defVal) {
|
||||||
|
// Check Query string followed by cookie
|
||||||
|
let val = WebUtil.getConfigVar(name);
|
||||||
|
if (val === null) {
|
||||||
|
val = WebUtil.readSetting(name, defVal);
|
||||||
|
}
|
||||||
|
WebUtil.setSetting(name, val);
|
||||||
|
return val;
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UI.prime();
|
UI.prime();
|
||||||
|
|
|
@ -248,7 +248,7 @@ export default class Display {
|
||||||
let targetDevicePixelRatio = 1.5;
|
let targetDevicePixelRatio = 1.5;
|
||||||
if (this._screens[i].pixelRatio > 2) { targetDevicePixelRatio = 2; }
|
if (this._screens[i].pixelRatio > 2) { targetDevicePixelRatio = 2; }
|
||||||
let scaledWidth = (width * this._screens[i].pixelRatio) * (1 / targetDevicePixelRatio);
|
let scaledWidth = (width * this._screens[i].pixelRatio) * (1 / targetDevicePixelRatio);
|
||||||
let scaleRatio = scaledWidth / x;
|
let scaleRatio = scaledWidth / width;
|
||||||
width = width * scaleRatio;
|
width = width * scaleRatio;
|
||||||
height = height * scaleRatio;
|
height = height * scaleRatio;
|
||||||
scale = 1 / scaleRatio;
|
scale = 1 / scaleRatio;
|
||||||
|
|
Loading…
Reference in New Issue