Since we only use _createBounds in one place now we can inline it.

This commit is contained in:
Jürg Lehni 2011-11-24 15:38:08 +01:00
parent 569c415b2f
commit 909b9040d5

View file

@ -1265,9 +1265,9 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
if (cache && this._bounds && this._bounds[cache])
return this._bounds[cache];
var bounds = this._getBounds(name, matrix);
// TODO:
if (name == 'bounds')
bounds = this._createBounds(bounds);
bounds = LinkedRectangle.create(this, 'setBounds',
bounds.x, bounds.y, bounds.width, bounds.height);
// If we can cache the result, update the _bounds cache structure
// before returning
if (cache) {
@ -1316,14 +1316,6 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
return Rectangle.create(x1, y1, x2 - x1, y2 - y1);
},
/**
* Creates a LinkedRectangle that when modified calls #setBounds().
*/
_createBounds: function(rect) {
return LinkedRectangle.create(this, 'setBounds',
rect.x, rect.y, rect.width, rect.height);
},
setBounds: function(rect) {
rect = Rectangle.read(arguments);
var bounds = this.getBounds(),