From: Joe Wreschnig Date: Tue, 23 Sep 2014 16:17:11 +0000 (+0200) Subject: Helper to set anchor without changing position value. X-Git-Url: https://git.yukkurigames.com/?a=commitdiff_plain;h=ab88709be9d7403859fd2ab2427daeb69307b5c6;p=yuu.git Helper to set anchor without changing position value. --- diff --git a/src/yuu/rdr.js b/src/yuu/rdr.js index 99b8c3f..552d593 100644 --- a/src/yuu/rdr.js +++ b/src/yuu/rdr.js @@ -176,6 +176,15 @@ b[3] = b[7] = b[11] = b[15] = a; this._vbuf.dirty = true; } + }, + + anchorAtPosition: { + get: function () { return this.anchor; }, + set: function (a) { + var position = this.position; + this.anchor = a; + this.position = position; + } } }); @@ -297,6 +306,7 @@ size: { alias: "_quad.size", chainable: true }, position: { alias: "_quad.position", chainable: true }, anchor: { alias: "_quad.anchor", chainable: true }, + anchorAtPosition: { alias: "_quad.anchorAtPosition", chainable: true }, xy: { alias: "_quad.position", chainable: true }, texBounds: { alias: "_quad.texBounds", chainable: true }, color: { alias: "_quad.color", chainable: true },