Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

Changed how foreground image is created to prevent "a.indexOf" is not… #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/wScratchPad.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,14 @@
}
else {
// Have to load image before we can use it.
$(new Image())
.attr('crossOrigin', '')
.attr('src', this.options.fg)
.load(function () {
_this.ctx.drawImage(this, 0, 0, width, height);

var fgImg = new Image();
fgImg.src = this.options.fg;

fgImg.onload = function() {
_this.ctx.drawImage(this, 0, 0, width, height);
_this.$img.show();
});
};
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion wScratchPad.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.