Clean up bounds scope indentation.

This commit is contained in:
Jürg Lehni 2012-12-18 14:19:13 +01:00
parent 9a8dddd7df
commit c63e2c8f79

View file

@ -561,25 +561,25 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
return true; return true;
} }
}, Base.each(['getBounds', 'getStrokeBounds', 'getHandleBounds', 'getRoughBounds'], }, Base.each(['getBounds', 'getStrokeBounds', 'getHandleBounds', 'getRoughBounds'],
function(name) { function(name) {
// Produce getters for bounds properties. These handle caching, matrices // Produce getters for bounds properties. These handle caching, matrices
// and redirect the call to the private _getBounds, which can be // and redirect the call to the private _getBounds, which can be
// overridden by subclasses, see below. // overridden by subclasses, see below.
this[name] = function(_matrix) { this[name] = function(_matrix) {
var getter = this._boundsGetter, var getter = this._boundsGetter,
bounds = this._getCachedBounds( // Allow subclasses to override _boundsGetter if they use
// Allow subclasses to override _boundsGetter if they use the // the same calculations for multiple type of bounds.
// same calculations for multiple type of bounds.
// The default is name: // The default is name:
typeof getter == 'string' ? getter : getter && getter[name] || name, bounds = this._getCachedBounds(typeof getter == 'string'
_matrix); ? getter : getter && getter[name] || name, _matrix);
// If we're returning 'bounds', create a LinkedRectangle that uses the // If we're returning 'bounds', create a LinkedRectangle that uses
// setBounds() setter to update the Item whenever the bounds are // the setBounds() setter to update the Item whenever the bounds are
// changed: // changed:
return name == 'bounds' ? LinkedRectangle.create(this, 'setBounds', return name == 'bounds' ? LinkedRectangle.create(this, 'setBounds',
bounds.x, bounds.y, bounds.width, bounds.height) : bounds; bounds.x, bounds.y, bounds.width, bounds.height) : bounds;
}; };
}, /** @lends Item# */{ },
/** @lends Item# */{
/** /**
* Private method that deals with the calling of _getBounds, recursive * Private method that deals with the calling of _getBounds, recursive
* matrix concatenation and handles all the complicated caching mechanisms. * matrix concatenation and handles all the complicated caching mechanisms.