添加绝对坐标

This commit is contained in:
Harvey Zack committed 2019-05-09 18:15:35 +08:00
1 parent c95d379064
commit 0335c678d5
3 files changed
+25 -3

No files matched your search

+11 -1
View File
@@ -3240,13 +3240,23 @@
return art.template.$player.getBoundingClientRect();
}
});
['bottom', 'height', 'left', 'right', 'top', 'width', 'x', 'y'].forEach(function (key) {
['bottom', 'height', 'left', 'right', 'top', 'width'].forEach(function (key) {
Object.defineProperty(player, key, {
get: function get() {
return player.rect[key];
}
});
});
Object.defineProperty(player, 'x', {
get: function get() {
return player.left + window.pageXOffset;
}
});
Object.defineProperty(player, 'y', {
get: function get() {
return player.top + window.pageYOffset;
}
});
}
function flipMix(art, player) {