Scroll position/moveTo() issue
See original GitHub issueHi there.
I am trying to design a “teminal-style” pane which displays incoming data from a serial port, using a StyleTextArea
object.
New text is appended onto the end of the StyleTextArea
object and removed from the beginning, to keep the total number of characters in the view the same.
I want the user to be able to scroll to say, halfway, and have the text he/she sees remain constant. Keeping the current view constant is easy if I had a way of finding what value moveTo()
would result in the current view, as I can count how many characters have been removed, and then call moveTo()
again with newValue = oldValue - numCharsRemoved
.
If there any way to achieve this functionality? I was able to do it with a normal TextFlow
node using the scrollY
value (when it was wrapped in a ScrollPane
), but since I read that getEstimatedScrollY()
on a VirtualizedScrollPane
does not work correctly if their are font size changes or wrapped lines, I’m not sure if I can rely on this.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
It sounds somewhat similar to #385.
Closing as this should be resolved for the most part by #418.