Fix text tool cursors and improve naming#1707
Merged
Merged
Conversation
cameronwhite
left a comment
Member
There was a problem hiding this comment.
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; |
Member
There was a problem hiding this comment.
I think it might be possible to simplify this even further and get rid of the extra flag here
- We can check whether
trackingis true to know whether a right click drag is currently happening - We can also check whether
CurrentCursor == DefaultCursoror compare tocursor_invalidto 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?
Contributor
Author
There was a problem hiding this comment.
Good point. I simplified the code a bit further. Let me know what you think about it.
Member
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.