mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 00:31:20 -08:00
添加绝对坐标
This commit is contained in:
1 parent
c95d379064
commit
0335c678d5
3 files changed
+25
-3
No files matched your search
@@ -5,11 +5,23 @@ export default function rectMix(art, player) {
|
||||
},
|
||||
});
|
||||
|
||||
['bottom', 'height', 'left', 'right', 'top', 'width', 'x', 'y'].forEach(key => {
|
||||
['bottom', 'height', 'left', 'right', 'top', 'width'].forEach(key => {
|
||||
Object.defineProperty(player, key, {
|
||||
get: () => {
|
||||
return player.rect[key];
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Object.defineProperty(player, 'x', {
|
||||
get: () => {
|
||||
return player.left + window.pageXOffset;
|
||||
},
|
||||
});
|
||||
|
||||
Object.defineProperty(player, 'y', {
|
||||
get: () => {
|
||||
return player.top + window.pageYOffset;
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user