From: Joe Wreschnig Date: Wed, 17 Sep 2014 17:10:20 +0000 (+0200) Subject: Add anchorAtPosition to preserve position when setting anchor. X-Git-Url: https://git.yukkurigames.com/?p=featherfall2.git;a=commitdiff_plain;h=c6354eb6e6a63ba19bc2c7879bafeea12e72fe3e;hp=7f19eb4b8237b305b3d315a137c89a706011b3e4 Add anchorAtPosition to preserve position when setting anchor. --- 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 },