Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to programmatically scroll to Node with ScrollPane that is bound to VirtualizedScrollPane #17

Closed
JordanMartinez opened this issue Dec 8, 2015 · 4 comments

Comments

@JordanMartinez
Copy link
Contributor

I've asked this on StackOverflow, since that seems like the place to have that discussion. However, I am also opening an issue here because I think you, @TomasMikula , would probably be one of the few who could answer this specific question.

@TomasMikula
Copy link
Member

Do the nodes in the ScrollPane have any correspondence to items in the VirtualFlow (assuming that the VirtualizedScrollPane contains a VirtualFlow). If so, I would bring the VirtualFlow's item to the viewport using VirtualFlow.showAsFirst(itemIndex) and let the ScrollPane adjust automatically.

@JordanMartinez
Copy link
Contributor Author

Yes and no :-D

ScrollPane {
    HBox {
        LeafPane { // these Nodes match up with each line in StyledTextArea
            Node
            Nodes...
        }
        ParentPane { // these Nodes are unpredictable in their layout
            Node
            Nodes...
        }
        Higher ParentPanes and and their Nodes {} // unpredictable in their layout
    }
}

So, such a thing would work for the Nodes in the LeafPane but not for any in the ParentPanes

@TomasMikula
Copy link
Member

Well, then it doesn't seem to be Flowless related. I don't know why your approach would not work. You can convert coordinates relative to a node to coordinates relative to its parent with the localToParent method. You will need to use it multiple times for deeper hierarchies.

@JordanMartinez
Copy link
Contributor Author

Ok, I guess I'll have to play around it with some more.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants