mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 00:31:20 -08:00
add Artplayer.LOG_VERSION
This commit is contained in:
1 parent
3179d1241e
commit
894a9db1d7
34 files changed
+182
-136
No files matched your search
@@ -21,7 +21,7 @@ function GetSlideDirection(startX, startY, endX, endY) {
|
||||
result = 1;
|
||||
} else if (angle >= -135 && angle < -45) {
|
||||
result = 2;
|
||||
} else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
|
||||
} else if ((angle >= 135 && angle <= 180) ?? (angle >= -180 && angle < -135)) {
|
||||
result = 3;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ export default function gestureInit(art, events) {
|
||||
const direction = GetSlideDirection(startX, startY, pageX, pageY);
|
||||
const isHorizontal = [3, 4].includes(direction);
|
||||
const isVertical = [1, 2].includes(direction);
|
||||
const isLegal = (isHorizontal && !art.isRotate) || (isVertical && art.isRotate);
|
||||
const isLegal = (isHorizontal && !art.isRotate) ?? (isVertical && art.isRotate);
|
||||
if (isLegal) {
|
||||
const ratioX = clamp((pageX - startX) / art.width, -1, 1);
|
||||
const ratioY = clamp((pageY - startY) / art.height, -1, 1);
|
||||
|
||||
Reference in new issue
Block a user