Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix issue with interactive graphic while parent was removed #1467

Merged
merged 3 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vrender-core",
"comment": "fix: fix issue with interactive graphic while parent was removed",
"type": "none"
}
],
"packageName": "@visactor/vrender-core"
}
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,17 @@ export class InteractiveDrawItemInterceptorContribution implements IDrawItemInte
// 默认使用原始的图元
const baseGraphic = graphic.baseGraphic as IGraphic;
// 如果主图元被删除了,那把交互图元这个也删除
if (!baseGraphic.stage) {
// 一直往上找
let intree = !!baseGraphic.stage;
let _g = baseGraphic.parent;
while (intree && _g) {
if ((_g as any).stage === _g) {
break;
}
intree = !!_g.stage;
_g = _g.parent;
}
if (!intree) {
const interactiveLayer = drawContext.stage.getLayer('_builtin_interactive');
if (interactiveLayer) {
const shadowRoot = this.getShadowRoot(interactiveLayer);
Expand Down
Loading