From 812244cbab9de512a4ab455690f0af443e74d2c4 Mon Sep 17 00:00:00 2001 From: AkiChase <1003019131@qq.com> Date: Wed, 19 Mar 2025 11:33:51 +0800 Subject: [PATCH] fix: rotationState not updated in time --- src/components/Device.vue | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/components/Device.vue b/src/components/Device.vue index fff45d5..ac67fec 100644 --- a/src/components/Device.vue +++ b/src/components/Device.vue @@ -153,6 +153,27 @@ onActivated(async () => { deviceName: curClientInfo.device_name, deviceID: curClientInfo.device_id, }; + if (curClientInfo.width < curClientInfo.height) { + const maskH = Math.round(store.rotation.verticalLength); + const maskW = Math.round( + maskH * (curClientInfo.width / curClientInfo.height) + ); + NonReactiveStore.mem.rotationState = { + direction: "vertical", + maskW, + maskH, + }; + } else { + const maskW = Math.round(store.rotation.horizontalLength); + const maskH = Math.round( + maskW * (curClientInfo.height / curClientInfo.width) + ); + NonReactiveStore.mem.rotationState = { + direction: "horizontal", + maskW, + maskH, + }; + } } } await horRotation();