fix: 热区截图问题

This commit is contained in:
wanganmao
2023-02-09 10:15:50 +08:00
parent af799a701a
commit 8f7239104a

View File

@@ -446,18 +446,16 @@ export default {
const setRect = (e) => {
setTimeout(() => {
// const el = e?.path?.[0] || e?.target; // chrome 浏览器获取不到元素
const el = pictureRef.value;
console.log(
"setRect",
e,
e?.path?.[0]?.getClientRects()[0] || e?.path?.[0]?.getClientRects()
el,
el?.getClientRects()[0] || el?.getClientRects()
);
try{
rect.value = JSON.parse(
JSON.stringify(e?.path?.[0]?.getClientRects()[0] || e?.path?.[0]?.getClientRects())
JSON.stringify(el?.getClientRects()[0] || el?.getClientRects())
);
}
catch{}
if (photoAreaRef2.value) {
photoAreaRef2.value.setRect(rect.value);
}