From c579433b3dfdb7c7161976355aa2d25bc8d2f6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 20 Oct 2013 17:45:01 +0200 Subject: [PATCH] Fix bug in Raster.onLoad() It was executing in wrong scope on websites with multiple scopes. --- src/item/Raster.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/item/Raster.js b/src/item/Raster.js index 8daa6ac5..d3e56a61 100644 --- a/src/item/Raster.js +++ b/src/item/Raster.js @@ -297,9 +297,12 @@ var Raster = Item.extend(/** @lends Raster# */{ image = document.getElementById(src) || new Image(); function loaded() { + var view = that._project.view; + if (view) + paper = view._scope; that.fire('load'); - if (that._project.view) - that._project.view.draw(true); + if (view) + view.draw(true); } // IE has naturalWidth / Height defined, but width / height set to 0