chore: remove frame overlay dependency from default-tool (#11762)
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import { OverlayIdentifier } from '@blocksuite/affine-block-surface';
|
||||
import {
|
||||
type FrameBlockModel,
|
||||
MindmapElementModel,
|
||||
} from '@blocksuite/affine-model';
|
||||
import { FrameBlockModel, MindmapElementModel } from '@blocksuite/affine-model';
|
||||
import {
|
||||
type DragExtensionInitializeContext,
|
||||
getTopElements,
|
||||
@@ -78,5 +75,22 @@ export class FrameHighlightManager extends InteractivityExtension {
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
this.event.on('pointermove', context => {
|
||||
const [x, y] = this.gfx.viewport.toModelCoord(
|
||||
context.event.x,
|
||||
context.event.y
|
||||
);
|
||||
const target = this.gfx.getElementByPoint(x, y);
|
||||
|
||||
if (
|
||||
target instanceof FrameBlockModel &&
|
||||
target.externalBound?.isPointInBound([x, y])
|
||||
) {
|
||||
this.frameHighlightOverlay.highlight(target);
|
||||
} else {
|
||||
this.frameHighlightOverlay.clear();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user