FXMisc / Flowless

Efficient VirtualFlow for JavaFX
BSD 2-Clause "Simplified" License
185 stars 38 forks source link

VirtualFlow returns incorrect height of first cell when in need of layout pass #4

Closed oddbjornkvalsund closed 9 years ago

oddbjornkvalsund commented 9 years ago

I've been experimenting with Flowless in the context of a log-viewer and so far it has suited my needs perfectly, thanks!

I do however have one use-case that I'm struggling to implement. I want the VirtualFlow to vertically resize dynamically to the size of its content up to the point where it's limited by it's parents size. See this gist: https://gist.github.com/oddbjornkvalsund/f232c0f61fdc368d704f

It almost works, but for the rendering of the first cell it seems to get the calculated height wrong when the VirtualFlow is need of a layout pass. See line 90 of the gist.

oddbjornkvalsund commented 9 years ago

This turned out to be PEBKAC on my part. Binding the VirtualFlows "visible" and "managed" properties to the list-not-empty property was a mistake. By instead setting the VirtualFlows minHeight, prefHeight and maxHeight initially to 0 it all works as expected.