修复右键开窗时坐标计算失败的BUG
This commit is contained in:
parent
191793fbf3
commit
f12879faa8
|
@ -771,9 +771,10 @@ export default defineComponent({
|
|||
open_window_request.paused = window.paused;
|
||||
open_window_request.play_speed = window.play_speed;
|
||||
|
||||
console.log(window);
|
||||
|
||||
//setTimeout(() => {
|
||||
setTimeout(() => {
|
||||
if (!window) {
|
||||
return;
|
||||
}
|
||||
switch (type) {
|
||||
case "polling":
|
||||
{
|
||||
|
@ -788,7 +789,8 @@ export default defineComponent({
|
|||
open_polling_request.muted = window.muted;
|
||||
open_polling_request.volume = window.volume;
|
||||
open_polling_request.paused = window.paused;
|
||||
open_polling_request.play_speed = window.play_speed;
|
||||
open_polling_request.play_speed =
|
||||
window.play_speed;
|
||||
GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.openPolling(open_polling_request);
|
||||
|
@ -808,7 +810,8 @@ export default defineComponent({
|
|||
open_window_request.muted = window.muted;
|
||||
open_window_request.volume = window.volume;
|
||||
open_window_request.paused = window.paused;
|
||||
open_window_request.play_speed = window.play_speed;
|
||||
open_window_request.play_speed =
|
||||
window.play_speed;
|
||||
if (signal_sources.length) {
|
||||
const signal_source = signal_sources[0];
|
||||
if (signal_source) {
|
||||
|
@ -819,7 +822,7 @@ export default defineComponent({
|
|||
|
||||
break;
|
||||
}
|
||||
//}, 100);
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -997,6 +1000,7 @@ export default defineComponent({
|
|||
if (!wall.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
const obj = await file_manage_dialog.value.showDialogAsync(
|
||||
"select",
|
||||
".mp4;.avi;.ts;.jpg;.png;"
|
||||
|
@ -1032,22 +1036,19 @@ export default defineComponent({
|
|||
const cell_width = 1.0 / $store.state.wall_col;
|
||||
const cell_height = 1.0 / $store.state.wall_row;
|
||||
|
||||
const x =
|
||||
parseInt(
|
||||
(
|
||||
const col = Math.floor(
|
||||
last_context_menu_pos_x.value /
|
||||
wall.value.offsetWidth /
|
||||
cell_width
|
||||
).toFixed(0)
|
||||
) * cell_width;
|
||||
const y =
|
||||
parseInt(
|
||||
(
|
||||
);
|
||||
const row = Math.floor(
|
||||
last_context_menu_pos_y.value /
|
||||
wall.value.offsetHeight /
|
||||
cell_height
|
||||
).toFixed(0)
|
||||
) * cell_height;
|
||||
);
|
||||
|
||||
const x = col * cell_width;
|
||||
const y = row * cell_height;
|
||||
|
||||
if (!isNaN(x) && !isNaN(y)) {
|
||||
const open_window_request =
|
||||
|
@ -1114,27 +1115,6 @@ export default defineComponent({
|
|||
.getCurrentClient()
|
||||
?.addSignalSource(entity);
|
||||
if (response && response.success) {
|
||||
const cell_width = 1.0 / $store.state.wall_col;
|
||||
const cell_height = 1.0 / $store.state.wall_row;
|
||||
|
||||
const x =
|
||||
parseInt(
|
||||
(
|
||||
last_context_menu_pos_x.value /
|
||||
wall.value.offsetWidth /
|
||||
cell_width
|
||||
).toFixed(0)
|
||||
) * cell_width;
|
||||
const y =
|
||||
parseInt(
|
||||
(
|
||||
last_context_menu_pos_y.value /
|
||||
wall.value.offsetHeight /
|
||||
cell_height
|
||||
).toFixed(0)
|
||||
) * cell_height;
|
||||
|
||||
if (!isNaN(x) && !isNaN(y)) {
|
||||
const open_window_request =
|
||||
new Protocol.OpenWindowRequestEntity(
|
||||
response.uuid,
|
||||
|
@ -1157,7 +1137,6 @@ export default defineComponent({
|
|||
.getCurrentClient()
|
||||
?.openWindow(open_window_request);
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue