-
Notifications
You must be signed in to change notification settings - Fork 1.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
Let scrolling follow the text cursor in a multiline text edit widget #165
Comments
This has not yet been implemented, so thanks for opening an issue on it! This might be pretty easy to implement by following the bread-crumbs of the implementation of https://docs.rs/egui/0.9.0/egui/struct.Response.html#method.scroll_to_me and https://docs.rs/egui/0.9.0/egui/struct.Ui.html#method.scroll_to_cursor |
Hmm I tried several variants of that but the results were a little unpredictable ... like, scrolling to a certain y-position never really scrolled to where I needed it ... But I guess I should give it another look ... |
Is there a solution for this yet? |
Haven't worked on this either for a while ... One problem I've frequently run into is that it seems hard to apply the abovementioned I think one thing that would be helpful is to have some method to detect whether the cursor moved out of the visible part of the text field, and in which direction ... |
Is there a way to use to use this with Looking at things in the debugger and it seems the clip area never really changes and seems to be the screen coordinates of the |
Ahh I think I figured it out. You need to calculate the position relative to row_range passed in. |
Is your feature request related to a problem? Please describe.
Problem: When editing longer text snippets in a multi-line text edit widget, the cursor just leaves the scroll area, and you have to follow it manually with the mouse.
Describe the solution you'd like
Have the scrolling follow the cursor automatically, without having to switch to the mouse.
I've made some experiments with the customized text edit widget I keep in a fork, but when trying to scroll to a certain position the results are somewhat unpredictable ...
The text was updated successfully, but these errors were encountered: