]> git.proxmox.com Git - novnc-pve.git/commitdiff
improve resize for firefox
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 7 Aug 2014 07:53:21 +0000 (09:53 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 7 Aug 2014 07:53:21 +0000 (09:53 +0200)
pveui.js

index 6deff28095c3def7ff24c70e7fc62da6553fa078..7890cf008b38664d427b5f46f625fe0af1c17177 100644 (file)
--- a/pveui.js
+++ b/pveui.js
@@ -505,8 +505,10 @@ sizeUpdateTimer: undefined,
 
 updateFBSize: function(rfb, width, height) {
     try {
-       UI.lastFBWidth = width + 2;
-       UI.lastFBHeight = height + 6;
+       // 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 + 6)/2)*2;
 
        if (UI.sizeUpdateTimer !== undefined) {
            clearInterval(UI.sizeUpdateTimer);