RFR: 8323511 Scrollbar Click jumps inconsistent amount of pixels

Andy Goryachev angorya at openjdk.org
Wed Jan 10 16:05:35 UTC 2024


On Wed, 10 Jan 2024 12:31:20 GMT, Florian Kirmaier <fkirmaier at 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

For what it's worth, I just wanted to mention an alternative algorithm that was used in another project:

1. keep a cache of at least one screenful of laid out cells above and below the view port (a sliding window).  this enables correct scrolling when pixels (screen dimensions) are used, as in page up / page down, or when navigating close to the start/end
2. do not update scroll bar min/max/thumb while the user is scrolling using the scroll bar.  do update on MOUSE_RELEASED event.  this eliminates flicker when cells with different sizes come into play

Please let me know if you want to see the code.

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

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


More information about the openjfx-dev mailing list