[pve-devel] [PATCH novnc] fix height on resize

Dominik Csapak d.csapak at proxmox.com
Mon Aug 8 11:07:04 CEST 2016


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 at proxmox.com>
---
 debian/patches/pveui.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/patches/pveui.patch b/debian/patches/pveui.patch
index b613d98..b82ce35 100644
--- a/debian/patches/pveui.patch
+++ b/debian/patches/pveui.patch
@@ -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);
-- 
2.1.4





More information about the pve-devel mailing list