修复旋转计算错误

This commit is contained in:
Harvey committed 2020-11-24 14:10:06 +08:00
1 parent 8754fea23d
commit 77c766416e
3 files changed
+16 -26

No files matched your search

+2 -5
View File
@@ -23,11 +23,8 @@ export default function rotateMix(art, player) {
$player.dataset.rotate = deg;
const getScaleValue = () => {
const { clientWidth: videoWidth, clientHeight: videoHeight } = $video;
const { clientWidth: playerWidth, clientHeight: playerHeight } = $player;
const playerRatio = playerWidth / playerHeight;
const videoRatio = videoWidth / videoHeight;
return playerRatio > videoRatio ? playerWidth / videoHeight : playerHeight / videoWidth;
const { videoWidth, videoHeight } = $video;
return videoWidth > videoHeight ? videoHeight / videoWidth : videoWidth / videoHeight;
};
let degValue = 0;