On Mon, 15 Jan 2024 08:31:59 GMT, Florian Kirmaier <fkirma...@openjdk.org> 
wrote:

>> As seen in the unit test of the PR, when we click on the area above/below 
>> the scrollbar the position jumps - but the jump is now not always consistent.
>> In the current version on the last cell - the UI always jumps to the top. In 
>> the other cases, the assumed default cell height is used.
>> 
>> With this PR, always the default cell height is used, to determine how much 
>> is scrolled.
>> This makes the behavior more consistent.
>> 
>> Especially from the unit-test, it's clear that with this PR the behavior is 
>> much more consistent.
>> 
>> This is also related to the following PR: 
>> https://github.com/openjdk/jfx/pull/1194
>
> Florian Kirmaier has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   JDK-8323511
>   reverted accidental indentation chang

That's a good question. Since there are a number of scenario's that change the 
current position (offset) of the VirtualFlow, we have to be careful that those 
scenario's are not conflicting, and are using the same code when appropriate. 
Hence, duplicating code between VirtualFlow and VirtualScrollBar sounds 
dangerous (what if code is changed on one place but not on the other?)

Rather than shifting some logic to VirtualScrollBar, I believe it would be 
safer to have VirtualScrollBar calling into VirtualFlow. For mouse-scrollwheel 
events, this is already the case so it might be a good idea to do something 
similar here?

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

PR Comment: https://git.openjdk.org/jfx/pull/1326#issuecomment-2047392270

Reply via email to