修复双击无效的BUG

This commit is contained in:
fangxiang 2021-09-13 17:07:30 +08:00
parent a07f7e29b7
commit 250a5fa448
1 changed files with 10 additions and 2 deletions

View File

@ -282,6 +282,7 @@ export default defineComponent({
let focused = ref(false); let focused = ref(false);
let can_move = ref(true); let can_move = ref(true);
let can_resize = ref(true); let can_resize = ref(true);
let move_flag = false;
const onUnSelectAllWindows = () => { const onUnSelectAllWindows = () => {
selected.value = false; selected.value = false;
@ -331,6 +332,7 @@ export default defineComponent({
mouse_down_flag = false; mouse_down_flag = false;
mouse_last_pos_x = 0; mouse_last_pos_x = 0;
mouse_last_pos_y = 0; mouse_last_pos_y = 0;
move_flag = false;
}; };
const flags = new _Flags(); const flags = new _Flags();
@ -373,6 +375,7 @@ export default defineComponent({
mouse_last_pos_x = evt.x; mouse_last_pos_x = evt.x;
mouse_last_pos_y = evt.y; mouse_last_pos_y = evt.y;
move_flag = true;
} }
}, },
@ -411,21 +414,26 @@ export default defineComponent({
mouse_last_pos_x = evt.x; mouse_last_pos_x = evt.x;
mouse_last_pos_y = evt.y; mouse_last_pos_y = evt.y;
move_flag = true;
} }
}, },
cleanMouseDownFlag, cleanMouseDownFlag,
onMouseLeave(evt: MouseEvent) { onMouseLeave(evt: MouseEvent) {
if (selected.value && mouse_down_flag) { if (selected.value && mouse_down_flag) {
if (move_flag) {
emit("commit_geometry", props.window);
}
cleanMouseDownFlag(); cleanMouseDownFlag();
emit("commit_geometry", props.window);
} }
}, },
onMouseUp(evt: MouseEvent) { onMouseUp(evt: MouseEvent) {
if (selected.value && mouse_down_flag) { if (selected.value && mouse_down_flag) {
if (move_flag) {
emit("commit_geometry", props.window);
}
cleanMouseDownFlag(); cleanMouseDownFlag();
emit("commit_geometry", props.window);
} }
if (!focused) { if (!focused) {