diff --git a/src/basic/Point.js b/src/basic/Point.js index b5f5d7cf..969eda4e 100644 --- a/src/basic/Point.js +++ b/src/basic/Point.js @@ -33,6 +33,11 @@ var Point = Base.extend({ } }, + set: function(x, y) { + this.x = x; + this.y = y; + }, + /** * Returns a copy of the point. * This is useful as the following code only generates a flat copy: diff --git a/src/basic/Rectangle.js b/src/basic/Rectangle.js index c4f6a985..35444ed7 100644 --- a/src/basic/Rectangle.js +++ b/src/basic/Rectangle.js @@ -46,6 +46,13 @@ Rectangle = Base.extend({ } }, + set: function(x, y, width, height) { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + }, + getPoint: function() { return new Point(this.x, this.y); }, diff --git a/src/basic/Size.js b/src/basic/Size.js index 5ebd58bb..dae7c3fe 100644 --- a/src/basic/Size.js +++ b/src/basic/Size.js @@ -26,6 +26,11 @@ var Size = Base.extend({ } }, + set: function(width, height) { + this.width = width; + this.height = height; + }, + add: function() { var size = Size.read(arguments); return new Size(this.width + size.width, this.height + size.height);