mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-10 21:19:10 -04:00
Shorten create() methods, except for Point where it might have a performance impact.
This commit is contained in:
parent
90b94a8d83
commit
420e0435ed
3 changed files with 6 additions and 10 deletions
src/basic
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue