mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-28 17:02:24 -05:00
Add Raster#loaded to reflect the loading state of its image.
This commit is contained in:
parent
c378050783
commit
643df2d46d
2 changed files with 11 additions and 0 deletions
|
@ -171,6 +171,7 @@ contribute to the code.
|
|||
- Add `tolerance` argument to `Path#join(path, tolerance)`.
|
||||
- Add `Curve#getOffsetAtTime(time)`, as the reverse of
|
||||
`Curve#getTimeAt(offset)`.
|
||||
- Add `Raster#loaded` to reflect the loading state of its image.
|
||||
|
||||
### Fixed
|
||||
- Fix calculations of `Item#strokeBounds` for all possible combinations of
|
||||
|
|
|
@ -181,6 +181,16 @@ var Raster = Item.extend(/** @lends Raster# */{
|
|||
this.setSize(this.getWidth(), height);
|
||||
},
|
||||
|
||||
/**
|
||||
* The loading state of the raster image.
|
||||
*
|
||||
* @bean
|
||||
* @type Boolean
|
||||
*/
|
||||
getLoaded: function() {
|
||||
return this._loaded;
|
||||
},
|
||||
|
||||
isEmpty: function() {
|
||||
var size = this._size;
|
||||
return !size || size.width === 0 && size.height === 0;
|
||||
|
|
Loading…
Reference in a new issue