优化整体结构

This commit is contained in:
Harvey Zack committed 2019-04-30 13:06:24 +08:00
1 parent 9f9cb0e036
commit 487e865017
34 files changed
+505 -427

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
export default function rectMix(art, player) {
Object.defineProperty(player, 'rect', {
get: () => {
return art.template.$player.getBoundingClientRect();
},
});
['bottom', 'height', 'left', 'right', 'top', 'width', 'x', 'y'].forEach(key => {
Object.defineProperty(player, key, {
get: () => {
return player.rect[key];
},
});
});
}