Add auto-scroll behavior when selecting text outside the visible area in RichTextLabel#104715
Conversation
|
Does not work correctly when the RichTextLabel is rotated. |
73dde51 to
90c8483
Compare
|
@KoBeWi Thanks for the review! Already solved that problem. Here's the demo video. |
|
The dragging works correctly now, though another problem is that the scrolling happens on mouse events. So if you drag out of view, you can't scroll automatically, you need to keep moving the cursor. It's not very convenient. Also the implementation feels over-engineered. You added 3 methods, but each is used only once. At least one of them is redundant and their names could be better. |
c46200d to
7b3d1a5
Compare
|
@KoBeWi Thanks for the suggestions, already applied those changes. and I'm trying to mimic TextEdit's approach to handle automatic scrolling during text selection. seems that the gif tool would automatically filter out mouse... , but the functionality is working smoothly now. |
|
@AThousandShips Is this a problem that from my changes? error messages from CI:
|
KoBeWi
left a comment
There was a problem hiding this comment.
I see you used a Timer for scrolling 🤔
Seems to work fine now, but someone should test it with higher refresh rate.
f6b46da to
de21330
Compare
de21330 to
45ce520
Compare
already tested 30, 60, 120, 240 refresh rate with |
|
@KoBeWi May I ask what the process is for getting this PR reviewed and merged? |
Does your screen have 240Hz refresh rate though? |
yes... just bought one few month ago. It's a ROG STRIX G16 GeForce RTX 4060 version |
|
I requested extra review, but it might be not necessary. |
nice! Thanks a lot for the review. |
45ce520 to
8f7980b
Compare
… in RichTextLabel
8f7980b to
4774b57
Compare
|
Thanks! Congratulations on your first merged contribution! 🎉 |
Start the selection timer after a double-click so that dragging to extend a word selection works correctly. Regression introduced in godotengine#104715 which moved selection updates into a timer callback (click_select_held) but did not start the timer in the double-click handler, only in the single-click handler. Fixes godotengine#116860.
Start the selection timer after a double-click so that dragging to extend a word selection works correctly. Regression introduced in godotengine#104715 which moved selection updates into a timer callback (click_select_held) but did not start the timer in the double-click handler, only in the single-click handler. Fixes godotengine#116860.


Summary
This PR improves the text selection experience by ensuring that when the user drags the mouse outside the visible text area, the content scrolls automatically in the appropriate direction.
Changes
Why this is needed
Previously, when selecting text beyond the visible bounds, the scroll behavior was either inconsistent or non-existent, making text selection difficult for larger documents. This PR enhances usability by ensuring a fluid scrolling experience.
Testing