Shorten create() methods, except for Point where it might have a performance impact.

This commit is contained in:
Jürg Lehni 2011-03-06 21:02:57 +00:00
parent 90b94a8d83
commit 420e0435ed
3 changed files with 6 additions and 10 deletions
src/basic

View file

@ -287,12 +287,7 @@ var Rectangle = this.Rectangle = Base.extend({
statics: {
// See Point.create()
create: function(x, y, width, height) {
var rect = new Rectangle(Size.dont);
rect.x = x;
rect.y = y;
rect.width = width;
rect.height = height;
return rect;
return new Rectangle(Rectangle.dont).set(x, y, width, height);
}
}
});