修复双击无效的BUG
This commit is contained in:
parent
a07f7e29b7
commit
250a5fa448
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue