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:
parent
1457982881
commit
2d9d2b585f
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue