From ab88709be9d7403859fd2ab2427daeb69307b5c6 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Tue, 23 Sep 2014 18:17:11 +0200 Subject: [PATCH] Helper to set anchor without changing position value. --- 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.20.1