5
0
mirror of git://git.proxmox.com/git/novnc-pve.git synced 2025-01-03 05:17:56 +03:00

fix height on resize

it already was in the comment but i forgot it:

some browsers need an even size,
so we do Floor(x/2)*2

but if we have an uneven height, we get a window
that is a pixel too small, resulting in a scrollbar

so we have to add 1 first (like with the width)
Floor((x+1)/2)*2

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2016-08-08 11:07:04 +02:00 committed by Dietmar Maurer
parent a42cfd1514
commit 6bd3883761

View File

@ -793,7 +793,7 @@ index cb5717c..ceaa4fc 100644
+ // Note1: CSS Canvas size is wrong by a few pixels in Chrome
+ // Note2: window size must be even number for firefox
+ UI.lastFBWidth = Math.floor((width + 1)/2)*2;;
+ UI.lastFBHeight = Math.floor((height)/2)*2;
+ UI.lastFBHeight = Math.floor((height + 1)/2)*2;
+
+ if (UI.sizeUpdateTimer !== undefined) {
+ clearInterval(UI.sizeUpdateTimer);