[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3' - loleaflet/src

Pranav Kant pranavk at collabora.co.uk
Tue Mar 20 09:31:32 UTC 2018


 loleaflet/src/control/Control.LokDialog.js |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 37659326d9d081434c9b22b86849495a1211ceb1
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Tue Mar 20 14:46:19 2018 +0530

    lokdialog: Avoid flickering of dialog's child window
    
    Setting canvas's width, height unnecessarily have a bad effect - it
    flickers.
    
    Change-Id: Ic00a7ab392b03ee7a66099255e21ebb7c8973314
    (cherry picked from commit 2d9d2b585f0bf55fce01f30507932d9faad14397)
    Reviewed-on: https://gerrit.libreoffice.org/51627
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index 11a18ce78..bb1c0eb9d 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -365,8 +365,10 @@ L.Control.LokDialog = L.Control.extend({
 		if (!canvas)
 			return; // no floating window to paint to
 
-		canvas.width = width;
-		canvas.height = height;
+		if (width !== canvas.width)
+			canvas.width = width;
+		if (height !== canvas.height)
+			canvas.height = height;
 		var ctx = canvas.getContext('2d');
 		img.onload = function() {
 			ctx.drawImage(img, 0, 0);


More information about the Libreoffice-commits mailing list