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

Incorrect cursor displayed when hovering over a non-resizable node's "resize rect" #383

Open
mariusalexander opened this issue Apr 3, 2023 · 0 comments

Comments

@mariusalexander
Copy link

mariusalexander commented Apr 3, 2023

Summary

When hovering over the "resize rect" of a non-resizeable node (bottom right in the default painting style) the cursor changes to Qt::SizeFDiagCursor even tough it is not resizeable.

Potential fix

A quick search led me to the following code snippet:

if ((_graphModel.nodeFlags(_nodeId) | NodeFlag::Resizable)
&& geometry.resizeHandleRect(_nodeId).contains(QPoint(pos.x(), pos.y()))) {
setCursor(QCursor(Qt::SizeFDiagCursor));
} else {
setCursor(QCursor());
}

Instead of using a bitwise OR (|) one should use a bitwise AND (&) operation here, since 0x0 | 0x1 (i.e. QtNodes::NoFlags OR QtNodes::Resizable) will always return true.

@ anyone who is reading this and has some spare time feel free to open a PR and apply the fix for me 😇

Kind regards

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

No branches or pull requests

1 participant