From 643df2d46d879648dc89ca6c57c3aca33fc3806d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 14 Jun 2016 17:08:32 +0200 Subject: [PATCH] Add Raster#loaded to reflect the loading state of its image. --- CHANGELOG.md | 1 + src/item/Raster.js | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e64c933..f28bf76a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/item/Raster.js b/src/item/Raster.js index acc888e2..8b8fba05 100644 --- a/src/item/Raster.js +++ b/src/item/Raster.js @@ -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;