mirror of
https://github.com/AkiChase/scrcpy-mask
synced 2024-11-09 09:41:17 +08:00
fix(KeySwipe): performance
This commit is contained in:
parent
fbbdb1b4b8
commit
9116a5758e
@ -104,7 +104,7 @@ function onAddButtonSelect(
|
|||||||
(keyMapping as KeyMappingKeySwipe).pos = [
|
(keyMapping as KeyMappingKeySwipe).pos = [
|
||||||
{ x: keyMapping.posX, y: keyMapping.posY },
|
{ x: keyMapping.posX, y: keyMapping.posY },
|
||||||
];
|
];
|
||||||
(keyMapping as KeyMappingKeySwipe).intervalBetweenPos = 0;
|
(keyMapping as KeyMappingKeySwipe).intervalBetweenPos = 100;
|
||||||
} else if (type === "SteeringWheel") {
|
} else if (type === "SteeringWheel") {
|
||||||
keyMapping.pointerId = 1;
|
keyMapping.pointerId = 1;
|
||||||
(keyMapping as unknown as KeyMappingSteeringWheel).key = {
|
(keyMapping as unknown as KeyMappingSteeringWheel).key = {
|
||||||
|
@ -102,6 +102,7 @@ function editSwipePoints() {
|
|||||||
message.info(t("pages.KeyBoard.Swipe.editTips"));
|
message.info(t("pages.KeyBoard.Swipe.editTips"));
|
||||||
keyboardStore.showButtonSettingFlag = false;
|
keyboardStore.showButtonSettingFlag = false;
|
||||||
keyboardStore.editSwipePointsFlag = true;
|
keyboardStore.editSwipePointsFlag = true;
|
||||||
|
keyboardStore.edited = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function swipePointDragHandlue(downEvent: MouseEvent, index: number) {
|
function swipePointDragHandlue(downEvent: MouseEvent, index: number) {
|
||||||
|
@ -957,10 +957,13 @@ function addSwipeShortcuts(
|
|||||||
pointerId: number,
|
pointerId: number,
|
||||||
intervalBetweenPos: number
|
intervalBetweenPos: number
|
||||||
) {
|
) {
|
||||||
for (const posObj of pos) {
|
const newPosList = pos.map((posObj) => {
|
||||||
posObj.x = Math.round((posObj.x / relativeSize.w) * store.screenSizeW);
|
return {
|
||||||
posObj.y = Math.round((posObj.y / relativeSize.h) * store.screenSizeH);
|
x: Math.round((posObj.x / relativeSize.w) * store.screenSizeW),
|
||||||
}
|
y: Math.round((posObj.y / relativeSize.h) * store.screenSizeH),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
addShortcut(
|
addShortcut(
|
||||||
key,
|
key,
|
||||||
async () => {
|
async () => {
|
||||||
@ -971,7 +974,7 @@ function addSwipeShortcuts(
|
|||||||
w: store.screenSizeW,
|
w: store.screenSizeW,
|
||||||
h: store.screenSizeH,
|
h: store.screenSizeH,
|
||||||
},
|
},
|
||||||
pos,
|
pos: newPosList,
|
||||||
intervalBetweenPos,
|
intervalBetweenPos,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user