Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@stefan-dangl
Copy link
Contributor

When moving the text box via right click, the cursor symbol changes at it should. However, when releasing, the cursor changes to a generic one rather then going back to the default text cursor. This commit fixes that.

Copy link
Member

@cameronwhite cameronwhite left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this! I think it might be possible to clean things up even further (see other comment)


//Whether or not the previous TextTool mouse cursor shown was the normal one.
private bool previous_mouse_cursor_normal = true;
private bool is_default_cursor = true;
Copy link
Member

Choose a reason for hiding this comment

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

I think it might be possible to simplify this even further and get rid of the extra flag here

  • We can check whether tracking is true to know whether a right click drag is currently happening
  • We can also check whether CurrentCursor == DefaultCursor or compare to cursor_invalid to know what state we're in otherwise

so I think UpdateMouseCursor() might be able to do all of the logic of which cursor to show base on these checks, and we don't need to explicitly call SetCursor (cursor_move) when starting a drag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I simplified the code a bit further. Let me know what you think about it.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! The new version looks good 👍

When moving the text box via right click, the cursor symbol changes at it
should. However, when releasing, the cursor changes to a generic one
rather then going back to the default text cursor. This commit
fixes that.
@cameronwhite cameronwhite merged commit 742ae20 into PintaProject:master Sep 2, 2025
7 checks passed
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.

2 participants