mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-06-25 20:21:20 +02:00
Add check for bad values for Display.autoscale()
This commit is contained in:
parent
c6c278f9d5
commit
79ab05192b
@ -503,6 +503,11 @@ export default class Display {
|
|||||||
}
|
}
|
||||||
|
|
||||||
autoscale(containerWidth, containerHeight) {
|
autoscale(containerWidth, containerHeight) {
|
||||||
|
if (containerWidth === 0 || containerHeight === 0) {
|
||||||
|
Log.Warn("Autoscale doesn't work when width or height is zero");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const vp = this._viewportLoc;
|
const vp = this._viewportLoc;
|
||||||
const targetAspectRatio = containerWidth / containerHeight;
|
const targetAspectRatio = containerWidth / containerHeight;
|
||||||
const fbAspectRatio = vp.w / vp.h;
|
const fbAspectRatio = vp.w / vp.h;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user