Skip to content

Commit 5d14a91

Browse files
committed
🐛 添加ipad的识别,并将鼠标滚轮事件取消检测
1 parent 5ed7cf7 commit 5d14a91

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

app/src/core/service/controlService/controller/concrete/ControllerCamera.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
import { CursorNameEnum } from "../../../../../types/cursors";
6+
import { isIpad, isMac } from "../../../../../utils/platform";
67
import { ArrayFunctions } from "../../../../algorithm/arrayFunctions";
78
import { LimitLengthQueue } from "../../../../dataStruct/LimitLengthQueue";
89
import { Vector } from "../../../../dataStruct/Vector";
@@ -347,6 +348,9 @@ const importantNumbers = new Set<number>([]); // 100, 133, 138, 166
347348
* @returns
348349
*/
349350
function isMouseWheel(event: WheelEvent): boolean {
351+
if (isIpad || isMac) {
352+
return true;
353+
}
350354
if (event.deltaX !== 0 && event.deltaY !== 0) {
351355
// 斜向滚动肯定不是鼠标滚轮。因为滚轮只有横向滚轮和竖向滚轮
352356
return false;

app/src/utils/platform.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export const isWeb = !("__TAURI_OS_PLUGIN_INTERNALS__" in window);
55
export const isMobile = isWeb ? navigator.userAgent.toLowerCase().includes("mobile") : platform() === "android";
66
export const isDesktop = !isMobile;
77

8+
export const isIpad = isWeb && navigator.userAgent.toLowerCase().includes("mac os");
9+
810
export const isFrame =
911
isWeb && (new URLSearchParams(window.location.search).get("frame") === "true" || import.meta.env.LR_FRAME === "true");
1012

0 commit comments

Comments
 (0)