lokdialog: Avoid flickering of dialog's child window

Setting canvas's width, height unnecessarily have a bad effect - it
flickers.

Change-Id: Ic00a7ab392b03ee7a66099255e21ebb7c8973314
This commit is contained in:
Pranav Kant 2018-03-20 14:46:19 +05:30
parent 1457982881
commit 2d9d2b585f

View file

@ -367,8 +367,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);