RFR: 8298728: Cells in VirtualFlow jump after resizing [v2]

Ajit Ghaisas aghaisas at openjdk.org
Tue Jan 3 12:05:01 UTC 2023


On Tue, 20 Dec 2022 17:49:13 GMT, Johan Vos <jvos at openjdk.org> wrote:

>> When recalculating sizes, we often don't want the current index and/or offset to change.
>> 
>> Allow to fix the index/offset when doing recalculations.
>> 
>> Fix JDK-8298728
>
> Johan Vos has updated the pull request incrementally with one additional commit since the last revision:
> 
>   move statements to new lines.
>   Add another failing test, and a fix: when the cell that is positioned at the "current index"
>   is resized, we also need to modify the offset (wich is calculated from the top of that cell
>   to the start of the viewport).

Overall fix looks good to me.

I have identified two very minor typos.

modules/javafx.controls/src/main/java/javafx/scene/control/skin/VirtualFlow.java line 2329:

> 2327:             getOrCreateCellSize(index - 1);
> 2328:         }
> 2329:         if (index < getCellCount() -1) {

Minor : Need a space after `-`

modules/javafx.controls/src/test/java/test/javafx/scene/control/skin/VirtualFlowTest.java line 1473:

> 1471: 
> 1472: 
> 1473:         for (int i =0 ; i < heights.length; i++) {

Minor : Need a space after `=`

-------------

PR: https://git.openjdk.org/jfx/pull/974


More information about the openjfx-dev mailing list