From f4f3e3740c68229a5c0321c2fec4bd0e8e048092 Mon Sep 17 00:00:00 2001 From: cf-erp Date: Thu, 18 Jul 2024 03:30:03 +0000 Subject: [PATCH] =?UTF-8?q?!2887=20=E4=BF=AE=E5=A4=8D=20ios=2016.4?= =?UTF-8?q?=E4=BB=A5=E4=B8=8B=E7=B3=BB=E7=BB=9F=E5=9B=A0=E4=B8=BA=E4=B8=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81orientation=E6=97=A0=E6=B3=95=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Add-on/ShareView/ShareViewCameraControl.ts | 15 +++++++++------ .../ShareView/components/HouseRoamingButton.tsx | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Add-on/ShareView/ShareViewCameraControl.ts b/src/Add-on/ShareView/ShareViewCameraControl.ts index 3ce531c5e..c53ca0f6c 100644 --- a/src/Add-on/ShareView/ShareViewCameraControl.ts +++ b/src/Add-on/ShareView/ShareViewCameraControl.ts @@ -84,13 +84,16 @@ export class ShareViewCameraControl extends CameraControls { // ShareView中用更改FOV的方式替换原有的透视相机缩放逻辑(CameraControl难以重写) this.Viewer.CameraControl.Fov = clamp(this.Viewer.CameraControl.Fov * scale, this.minFov, this.maxFov); - if (screen.orientation.type.startsWith("portrait")) + if (screen.orientation) { - this.shareViewStore.userFovPortrait = scale; - } - else if (screen.orientation.type.startsWith("landscape")) - { - this.shareViewStore.userFovLandscape = scale; + if (screen.orientation.type.startsWith("portrait")) + { + this.shareViewStore.userFovPortrait = scale; + } + else if (screen.orientation.type.startsWith("landscape")) + { + this.shareViewStore.userFovLandscape = scale; + } } } else diff --git a/src/Add-on/ShareView/components/HouseRoamingButton.tsx b/src/Add-on/ShareView/components/HouseRoamingButton.tsx index e07dff6c9..45e6da9e5 100644 --- a/src/Add-on/ShareView/components/HouseRoamingButton.tsx +++ b/src/Add-on/ShareView/components/HouseRoamingButton.tsx @@ -66,6 +66,7 @@ function HouseRoamingButton() shareViewStore.userFovLandscape = defaultFovLandscape; function initFov() { + if (!screen.orientation) return; if (screen.orientation.type.startsWith("portrait")) shareViewApp.Viewer.CameraCtrl.Fov = shareViewStore.userFovPortrait; else if (screen.orientation.type.startsWith("landscape"))