RFR: 8277785: ListView scrollTo jumps to wrong location when CellHeight is changed [v4]
Florian Kirmaier
fkirmaier at openjdk.java.net
Tue Apr 12 11:51:37 UTC 2022
On Wed, 30 Mar 2022 13:27:40 GMT, Johan Vos <jvos at openjdk.org> wrote:
>> When the size of a ListCell is changed and a scrollTo method is invoked without having a layout calculation in between, the old (wrong) size is used to calculcate the total estimate. This happens e.g. when the size is changed in the `updateItem` method.
>> This PR will immediately resize the cell and sets the new value in the cache containing the cellsizes.
>
> Johan Vos has updated the pull request incrementally with one additional commit since the last revision:
>
> Don't shift cells if we are already showing the lowest index cell.
I've added another testbutton to the testclass.
When we jump to somewhere in the middle, the selected index is not at the top, but somewhere else.
Depending on the application, this can be quite a bit.
In the affected application - it sometimes still jumps to places closer to the wrong cell compared to the right cell.
The cell #2 should be at the top, but isnt.
<img width="662" alt="Screenshot 2022-04-12 at 13 47 49" src="https://user-images.githubusercontent.com/6547435/162953335-39d40eed-35a7-4728-912b-18a8acce5256.png">
-------------
PR: https://git.openjdk.java.net/jfx/pull/712
More information about the openjfx-dev
mailing list