Skip to content

Commit

Permalink
Merge pull request #2335 from asturur/fix-pattern-toObject
Browse files Browse the repository at this point in the history
Fix pattern to object
  • Loading branch information
kangax committed Jul 14, 2015
2 parents 033402d + fbd3f17 commit ed3264a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pattern.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ fabric.Pattern = fabric.util.createClass(/** @lends fabric.Pattern.prototype */
else if (typeof this.source.src === 'string') {
source = this.source.src;
}
// <canvas> element
else if (typeof this.source === 'object' && this.source.toDataURL) {
source = this.source.toDataURL();
}

return {
source: source,
Expand Down

0 comments on commit ed3264a

Please sign in to comment.