Helper to set anchor without changing position value.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Tue, 23 Sep 2014 16:17:11 +0000 (18:17 +0200)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Tue, 23 Sep 2014 16:17:11 +0000 (18:17 +0200)
src/yuu/rdr.js

index 99b8c3f56e142499432dda1612a56e170fec7c2e..552d593aad9a4514fede443e650467510c9b9278 100644 (file)
                 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;
+            }
         }
     });
 
         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 },