diff --git a/src/components/ControlPanelDialog.vue b/src/components/ControlPanelDialog.vue index 33be639..2b37e8d 100644 --- a/src/components/ControlPanelDialog.vue +++ b/src/components/ControlPanelDialog.vue @@ -591,19 +591,44 @@ export default defineComponent({ const item = test_monitor_wall.value[current_index.value] const point_list=four_point(); if (wall_dom) { - // if(item.angle!=0&&point_list){ - // return Math.floor(item.centerx) - // }else{ + if(item.angle!=0&&point_list){ + let minx=0; + point_list.forEach((element)=>{ + if(minx>element.x){ + minx=element.x; + } + }) + if(minx<0){ + return Math.floor(item.w/2+item.currentx+Math.abs(minx)) + }else { return Math.floor(item.w / 2) - // } + } + }else{ + return Math.floor(item.w / 2) + } } }; const max_x = () => { const wall_dom = wall.value const item = test_monitor_wall.value[current_index.value] + const point_list=four_point(); if (wall_dom) { - return Math.floor(wall_dom.offsetWidth - item.w / 2) + if(item.angle!=0&&point_list){ + let maxx=0; + point_list.forEach((element)=>{ + if(maxxwall_dom.offsetWidth){ + return Math.floor(item.currentx+item.w/2-(maxx-wall_dom.offsetWidth)) + }else{ + return Math.floor(wall_dom.offsetWidth - item.w / 2) + } + }else{ + return Math.floor(wall_dom.offsetWidth - item.w / 2) + } } }; const set_y = () => { @@ -612,7 +637,6 @@ export default defineComponent({ const item = test_monitor_wall.value[current_index.value] const ry: number = item.currenty + item.h; if (wall_dom) { - if (ry > wall_dom.offsetHeight) { item.currenty = wall_dom.offsetHeight - item.h return item.currenty; @@ -625,15 +649,46 @@ export default defineComponent({ const min_y = () => { const wall_dom = wall.value const item = test_monitor_wall.value[current_index.value] + const point_list=four_point(); if (wall_dom) { - return Math.floor(item.h / 2) + if(item.angle!=0&&point_list){ + let miny=0; + point_list.forEach((element)=>{ + if(miny>element.y){ + miny=element.y; + } + }) + if(miny<0){ + return Math.floor(item.h/2+item.currenty+Math.abs(miny)) + }else{ + return Math.floor(item.h / 2) + } + }else{ + return Math.floor(item.h / 2) + + } } }; const max_y = () => { const wall_dom = wall.value const item = test_monitor_wall.value[current_index.value] + const point_list=four_point(); if (wall_dom) { - return Math.floor(wall_dom.offsetHeight - item.h / 2) + if(item.angle!=0&&point_list){ + let maxy=0; + point_list.forEach((element)=>{ + if(maxywall_dom.offsetHeight){ + return Math.floor(item.currenty+item.h/2-(maxy-wall_dom.offsetHeight)) + }else{ + return Math.floor(wall_dom.offsetHeight - item.h / 2) + } + }else{ + return Math.floor(wall_dom.offsetHeight - item.h / 2) + } } }; const max_angle=()=>{ @@ -685,7 +740,7 @@ export default defineComponent({ item.centerx = Math.floor(item.currentx + item.w / 2) item.centery = Math.floor(item.currenty + item.h / 2) } - + }; const isexceed=(element:test_monitor)=>{ // element.currentx / wall_dom.offsetWidth @@ -706,7 +761,6 @@ export default defineComponent({ } } - return element; }; @@ -854,8 +908,8 @@ export default defineComponent({ const response = await client.getMagicWallConfig(); const cloud_monitor_list = new MagicWallConfig(); cloud_monitor_list.magic_wall_enable = true;//response?.config.magic_wall_enable ?? true; - cloud_monitor_list.col = parseInt((settings.wall_col).toString()) - cloud_monitor_list.row =parseInt((settings.wall_row).toString()) + cloud_monitor_list.col = parseInt((settings.wall_col).toString()) + cloud_monitor_list.row =parseInt((settings.wall_row).toString()) let tep_width = 0; test_monitor_wall.value.forEach((element, index) => { if (element.isShow) {