-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Fixed RichTextLabel wrong selection offset after drop cap #71747
Fixed RichTextLabel wrong selection offset after drop cap #71747
Conversation
ec3b9f1
to
5b3f1dd
Compare
Here are two comparison screen videos showing before/after PR fix. Without the fix, the selection start is offset from the mouse location by the width of the dropcap: Screen.Recording.2023-02-13.at.8.59.56.AM.movWith the fix, the selection is correctly linked to the mouse location: Screen.Recording.2023-02-13.at.9.02.44.AM.mov |
If this code is not valid yet, then there is no point leaving it there. You can stash the changes and work on it after we merge this. So please strip these lines from the PR. |
089e26f
to
175557d
Compare
You need to squash your commits. |
175557d
to
99376ee
Compare
Is there a mechanism somewhere for adding code comments like this one for the benefit of a different, future contributor? I'll have my own comments, but it could save someone else some effort? |
You can comment your suggestion on an issue which you are trying to solve. If there is no issue, you can open one and leave a comment there. Code comments aren't discoverable and having dead code in the codebase is mostly just contributes to the noise. And you also cannot guarantee that your solution is the correct one, so leaving it in the code would be misleading. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. bruvzg approved, commented out lines were removed.
Thanks! |
I agree with these good observations - thanks! |
Fixes an issue in RichTextLabel where starting a selection, or selecting across a drop cap, would incorrectly start the selection offset by the width of the drop cap.
I would recommend leaving in the comments, because this is where a future improvement would fix the issue of the drop cap text not currently being selectable, and figuring out how to obtain the drop cap text is not obvious.