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 custom widget mouseover #339

Merged
merged 1 commit into from
Nov 23, 2024
Merged

Fix custom widget mouseover #339

merged 1 commit into from
Nov 23, 2024

Conversation

webfiltered
Copy link
Contributor

@webfiltered webfiltered commented Nov 23, 2024

Resolves #338

LGraphCanvas.node_widget is set during processMouseDown - a legacy state variable that is set to the last widget that was clicked. Cleared on pointerup.

Some custom widgets expect to handle all pointer events, whilst others expect to only receive pointerdown events. The API was unclear, so guesswork appears to have been used.

Using node_widget, they should only receive movement events whilst dragging on the widget.

Copy link
Member

@huchenlei huchenlei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why this solves the issue?

Always getting the first node_widget does not seem right to me.

@webfiltered
Copy link
Contributor Author

Ah sorry. Was trying to rush that out before I left. I'll update the PR.

@huchenlei huchenlei merged commit 696b8b2 into master Nov 23, 2024
4 checks passed
@huchenlei huchenlei deleted the custom-widget-mouseover branch November 23, 2024 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom widget click triggered on mouseover
2 participants