From c6354eb6e6a63ba19bc2c7879bafeea12e72fe3e Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Wed, 17 Sep 2014 19:10:20 +0200 Subject: [PATCH] Add anchorAtPosition to preserve position when setting anchor. --- src/yuu/rdr.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 }, -- 2.30.2