Move Item#isEmpty() out of bounds scope and define documentation for it.

This commit is contained in:
Jürg Lehni 2012-12-18 14:18:53 +01:00
parent 7622493d2e
commit 9a8dddd7df

View file

@ -547,6 +547,18 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
// Use Matrix#initialize to easily copy over values.
this._matrix.initialize(matrix);
this._changed(/*#=*/ Change.GEOMETRY);
},
/**
* Specifies wether the item has any content or not. The meaning of what
* content is differs from type to type. For example, a {@link Group} with
* no children, a {@link TextItem} with no text content and a {@link Path}
* with no segments all are considered empty.
*
* @type Boolean
*/
isEmpty: function() {
return true;
}
}, Base.each(['getBounds', 'getStrokeBounds', 'getHandleBounds', 'getRoughBounds'],
function(name) {
@ -680,10 +692,6 @@ function(name) {
return Rectangle.create(x1, y1, x2 - x1, y2 - y1);
},
isEmpty: function() {
return true;
},
setBounds: function(rect) {
rect = Rectangle.read(arguments);
var bounds = this.getBounds(),