Summary
Add the method double VirtualFlow.getViewportLength()
.
Problem
The ViewportLength can be used by controls interacting with the VirtualFlow, like the ScrollBars. Without this API, it's not possible to access the exact viewport of the VirtualFlow.
Solution
We make the previously existing method getViewportLength public.
We also slightly change the behavior. The scroll behavior when clicking on the scrollbar track is changed. Now it is scrolled by viewport length instead of the length of the empty cell. Furthermore, the alignment of the cells to the view top respectively bottom is no longer executed.
Specification
public double VirtualFlow.getViewportLength()
, based on the javadoc:
/**
* Returns the length of the viewport portion of the {@code VirtualFlow} as computed during the layout pass.
* For a vertical flow this is based on the height and for a horizontal flow on the width of the clip view.
*
* @return the viewport length in pixels
* @since 23
*/
Clicking in the scrollbar trough will now use the value of the new method to decide how much to scroll.
- csr of
-
JDK-8323511 Scrollbar Click jumps inconsistent amount of pixels
- Resolved