mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-03-13 16:33:28 -04:00
Have Raster serialize itself.
The source property either contains the link to the external source, or the data url.
This commit is contained in:
parent
e5180e6929
commit
e829440803
1 changed files with 6 additions and 1 deletions
|
@ -19,6 +19,11 @@
|
|||
*/
|
||||
var Raster = this.Raster = PlacedItem.extend(/** @lends Raster# */{
|
||||
_type: 'raster',
|
||||
_serializeFields: {
|
||||
name: null,
|
||||
source: null,
|
||||
matrix: new Matrix()
|
||||
},
|
||||
// Raster doesn't make the distinction between the different bounds,
|
||||
// so use the same name for all of them
|
||||
_boundsGetter: 'getBounds',
|
||||
|
@ -205,7 +210,7 @@ var Raster = this.Raster = PlacedItem.extend(/** @lends Raster# */{
|
|||
},
|
||||
|
||||
getSource: function() {
|
||||
return this._image && this._image.src || null;
|
||||
return this._image && this._image.src || this.toDataURL();
|
||||
},
|
||||
|
||||
// DOCS: Document Raster#setSource
|
||||
|
|
Loading…
Reference in a new issue