mirror of
https://github.com/AkiChase/scrcpy-mask
synced 2025-05-25 10:28:03 +08:00
fix: rotationState not updated in time
This commit is contained in:
parent
537a155cda
commit
812244cbab
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user