Add Raster#loaded to reflect the loading state of its image.

This commit is contained in:
Jürg Lehni 2016-06-14 17:08:32 +02:00
parent c378050783
commit 643df2d46d
2 changed files with 11 additions and 0 deletions

View file

@ -171,6 +171,7 @@ contribute to the code.
- Add `tolerance` argument to `Path#join(path, tolerance)`. - Add `tolerance` argument to `Path#join(path, tolerance)`.
- Add `Curve#getOffsetAtTime(time)`, as the reverse of - Add `Curve#getOffsetAtTime(time)`, as the reverse of
`Curve#getTimeAt(offset)`. `Curve#getTimeAt(offset)`.
- Add `Raster#loaded` to reflect the loading state of its image.
### Fixed ### Fixed
- Fix calculations of `Item#strokeBounds` for all possible combinations of - Fix calculations of `Item#strokeBounds` for all possible combinations of

View file

@ -181,6 +181,16 @@ var Raster = Item.extend(/** @lends Raster# */{
this.setSize(this.getWidth(), height); this.setSize(this.getWidth(), height);
}, },
/**
* The loading state of the raster image.
*
* @bean
* @type Boolean
*/
getLoaded: function() {
return this._loaded;
},
isEmpty: function() { isEmpty: function() {
var size = this._size; var size = this._size;
return !size || size.width === 0 && size.height === 0; return !size || size.width === 0 && size.height === 0;