fix: vectorKey

This commit is contained in:
cha0s 2019-03-22 11:23:12 -05:00
parent ab689beee9
commit c6e14e5eb8

View File

@ -30,11 +30,11 @@ export function VectorMixin(
};
meta.set = meta.set || function(vector) {
if (meta.track && meta.emit) {
if (this[vector][0] !== vector[0]) {
meta.emit.call(this, `${x}Changed`, this[vector][0], vector[0]);
if (this[vectorKey][0] !== vector[0]) {
meta.emit.call(this, `${x}Changed`, this[vectorKey][0], vector[0]);
}
if (this[vector][1] !== vector[1]) {
meta.emit.call(this, `${y}Changed`, this[vector][1], vector[1]);
if (this[vectorKey][1] !== vector[1]) {
meta.emit.call(this, `${y}Changed`, this[vectorKey][1], vector[1]);
}
}
this[meta.transformProperty(vectorKey)] = [vector[0], vector[1]];