mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Fix bug in Raster.onLoad()
It was executing in wrong scope on websites with multiple scopes.
This commit is contained in:
parent
160fe25cd1
commit
c579433b3d
1 changed files with 5 additions and 2 deletions
|
@ -297,9 +297,12 @@ var Raster = Item.extend(/** @lends Raster# */{
|
||||||
image = document.getElementById(src) || new Image();
|
image = document.getElementById(src) || new Image();
|
||||||
|
|
||||||
function loaded() {
|
function loaded() {
|
||||||
|
var view = that._project.view;
|
||||||
|
if (view)
|
||||||
|
paper = view._scope;
|
||||||
that.fire('load');
|
that.fire('load');
|
||||||
if (that._project.view)
|
if (view)
|
||||||
that._project.view.draw(true);
|
view.draw(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IE has naturalWidth / Height defined, but width / height set to 0
|
// IE has naturalWidth / Height defined, but width / height set to 0
|
||||||
|
|
Loading…
Reference in a new issue