From 304c00a75e11781c10ec62f9bf10c29fa13a559b Mon Sep 17 00:00:00 2001 From: Andrew Kim Date: Fri, 12 Apr 2013 12:08:02 -0700 Subject: [PATCH] Fix disappearing nodes Minor fix in jit.js, this bug was only seen in Webkit-based browsers such as Chrome/Chromium Change-Id: Ied1b2c68ce98d7d6b9385b9c2f3f56cf34ba8fed Signed-off-by: Andrew Kim --- opendaylight/web/root/src/main/resources/js/jit.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/opendaylight/web/root/src/main/resources/js/jit.js b/opendaylight/web/root/src/main/resources/js/jit.js index 0f9ef03304..7cfc200947 100644 --- a/opendaylight/web/root/src/main/resources/js/jit.js +++ b/opendaylight/web/root/src/main/resources/js/jit.js @@ -6115,10 +6115,10 @@ var MultiNodeHelper = { }; } else { ctx.drawImage(img,pos.x-32,pos.y-32); + img.onload = function() { + ctx.drawImage(img,pos.x-32,pos.y-32); + }; } - /*var width = 64, height = 55; - ctx.fillStyle = "rgba(0,0,0,0)"; - ctx.fillRect(pos.x - width / 2, pos.y - height / 2, width, height);*/ }, 'contains': function(npos, pos) { var width = 64, height = 55; @@ -6137,10 +6137,10 @@ var MultiNodeHelper = { }; } else { ctx.drawImage(img,pos.x-32,pos.y-32); + img.onload = function() { + ctx.drawImage(img,pos.x-32,pos.y-32); + }; } - /*var width = 64, height = 45; - ctx.fillStyle = "rgba(0,0,0,0)"; - ctx.fillRect(pos.x - width / 2, pos.y - height / 2, width, height);*/ }, 'contains': function(npos, pos) { var width = 64, height = 45; -- 2.36.6