8276313: ScrollPane scroll delta incorrectly depends on content height#660
8276313: ScrollPane scroll delta incorrectly depends on content height#660mstr2 wants to merge 4 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back mstrauss! A progress list of the required criteria for merging this PR into |
Webrevs
|
|
/reviewers 2 |
|
@kevinrushforth |
| double vPixelValue; | ||
| if (nodeHeight > 0.0) { | ||
| vPixelValue = vRange / nodeHeight; | ||
| vPixelValue = vRange / (nodeHeight - contentHeight); |
There was a problem hiding this comment.
This may result in divide by 0.
There was a problem hiding this comment.
Good catch! I've also fixed a few similar issues in other places.
| double hPixelValue; | ||
| if (nodeWidth > 0.0) { | ||
| hPixelValue = hRange / nodeWidth; | ||
| hPixelValue = hRange / (nodeWidth - contentWidth); |
There was a problem hiding this comment.
This may result in divide by 0.
| double vPixelValue = vRange / (nodeHeight - contentHeight); | ||
| vPixelValue = Double.isFinite(vPixelValue) ? vPixelValue : 0.0; |
There was a problem hiding this comment.
I liked the previous logic better and would have just changed the comparison to check (nodeHeight - contentHeight) > 0.0 (possibly saving the adjusted width or height in a local various to avoid doing it twice). As it is, this is replacing an explicit check on the source values with an out of range check on the result, which seems less intuitive. Also, the previous code did a > 0 test and the new code effectively does a != 0 test.
There was a problem hiding this comment.
I changed it to check the denominator values instead.
|
@mstr2 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 24 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@kevinrushforth, @aghaisas, @johanvos) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
I'll review in the next hours. |
johanvos
left a comment
There was a problem hiding this comment.
This looks good to me. This new approach is based on the delta between the total height and the visible height, instead of only the total height.
It might be good to capture this idea somehow in the commit message, but since it is clear from the code, I am totally ok with not changing the commit message.
|
/integrate |
|
/sponsor |
|
Going to push as commit 5805bf8.
Your commit was automatically rebased without conflicts. |
This PR fixes an issue where the scroll delta of ScrollPane incorrectly depends on the size of its content.
This leads to extremely slow scrolling when the content is only slightly larger than the ScrollPane.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jfx pull/660/head:pull/660$ git checkout pull/660Update a local copy of the PR:
$ git checkout pull/660$ git pull https://git.openjdk.java.net/jfx pull/660/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 660View PR using the GUI difftool:
$ git pr show -t 660Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jfx/pull/660.diff