fix: 热区截图问题
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user