FXMisc / Flowless

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

Bidirectional binding of length properties does not update both values correctly #43

Closed JordanMartinez closed 4 years ago

JordanMartinez commented 7 years ago

As reported in TomasMikula/RichTextFX#535, binding two Vertical-Gravity Virtualized content's estimatedScrollY properties bidirectionally doesn't update them correctly. If the call is prop1.bindBidirectionally(prop2), the two values will be correct whenever prop1 scrolls but not when prop2 scrolls.

Fibii commented 5 years ago

I had this same issue, but i found a workaround it, i used a listener on the estimatedScrollYProperty and then updated the other area using setValue as shown:

textArea.estimatedScrollYProperty().addListener((observable, oldValue, newValue) -> lineCounter.estimatedScrollYProperty().setValue(newValue));

update: this works for stopping the automatic endless scrolling, but still gets the values messed up sometimes.