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 the issue of mouse coordinates being misaligned when hovering ove… #6782

Open
wants to merge 2 commits into
base: v5
Choose a base branch
from
Open
Changes from 1 commit
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
6 changes: 4 additions & 2 deletions packages/g6/src/behaviors/create-edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@ export class CreateEdge extends BaseBehavior<CreateEdgeOptions> {
const { model, element } = this.context;

model.translateNodeTo(ASSIST_NODE_ID, [event.canvas.x, event.canvas.y]);

await element!.draw({ animation: false, silence: true })?.finished;
// 仅仅在事件在目标阶段才进行绘制
if (event.eventPhase === 2) {
await element!.draw({ animation: false, silence: true })?.finished;
}
};

private createEdge = (event: IElementEvent) => {
Expand Down