--- zogiLib/js/baselib.js 2010/06/18 19:45:08 1.13 +++ zogiLib/js/baselib.js 2011/02/14 16:33:43 1.14 @@ -84,6 +84,10 @@ function Size(w, h) { this.height = parseFloat(h); return this; } +Size.prototype.copy = function() { + // returns a copy of this Rectangle + return new Size(this.width, this.height); +} Size.prototype.toString = function() { return this.width + "x" + this.height; } @@ -97,6 +101,10 @@ function Position(x, y) { this.y = parseFloat(y); return this; } +Position.prototype.copy = function() { + // returns a copy of this Rectangle + return new Rectangle(this.x, this.y); +} Position.prototype.toString = function() { return this.x + "," + this.y; }