fix(stage): 当页面大小小于画布时,组件又处于画布边缘,moveable边框会超出画布,导致获取到画布外的元素

fix #546
This commit is contained in:
roymondchen 2023-11-13 16:22:13 +08:00
parent 436fb3f5aa
commit 3b789f4d13

View File

@ -83,6 +83,10 @@ export default class ActionManager extends EventEmitter {
private getRenderDocument: GetRenderDocument;
private mouseMoveHandler = throttle(async (event: MouseEvent): Promise<void> => {
if ((event.target as HTMLDivElement)?.classList?.contains('moveable-direction')) {
return;
}
const el = await this.getElementFromPoint(event);
if (!el) {
this.clearHighlight();
@ -90,7 +94,6 @@ export default class ActionManager extends EventEmitter {
}
this.emit('mousemove', event);
this.highlight(el);
}, throttleTime);