Skip to content

Scroll position/moveTo() issue #395

@gbmhunter

Description

@gbmhunter

Hi 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions