]> git.proxmox.com Git - novnc-pve.git/commitdiff
fix height on resize
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 8 Aug 2016 09:07:04 +0000 (11:07 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 8 Aug 2016 10:20:38 +0000 (12:20 +0200)
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>
debian/patches/pveui.patch

index b613d98958ea3d916cee2a496904348536e3d71e..b82ce358adaefece8d4969795708aa903da76bc4 100644 (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);