jfx
jfx copied to clipboard
8218745: TableView: visual glitch at borders on horizontal scrolling
This PR fixes an issue which is probably in JavaFX since VirtualFlow exists. While horizontal scrolling any VirtualFlow control the left blue border sometimes disappear/gets smaller. (see also image below)
This can be fixed by snapping the scroll bar value (similar like e.g. a ScrollPane does). The same needs to be done on the table header as otherwise the column lines might be 1 px off to the cell lines. As a side effect this also fixes that the column lines sometimes get's blurry when horizontal scrolling (see second image).
While testing with -Dglass.win.uiScale I found out that the problem is not fixed for a scale like 1.25 or 1.5, while it is fixed for 1 or 2. The border sometimes disappears only when the snapped value is a decimal number (which obviously does not happen on a scale of 1 or 2), e.g. something like 12.6 but it will never disappear when it's a normal number, so e.g. just 12.
That's why something like Math.round(..) or just a cast to an int instead of snapping fixes this problem for all scales. I also didn't notice any side effect. But not sure if this the right fix then. How does JavaFX render a node when e.g. the x is a decimal number? And does a decimal number make sense (Why we e.g. don't round the value)?
Another explanation could also be that there is an issue somewhere deep inside the node layout/snapping/Clip/Group/pixel rendering and to simply round/cast the value just fixes the symptom here.
In any case I'm open for any feedback, help or explaination. I'm also glad for anything which might help identify the root cause here, if any.
Progress
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
- [ ] Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)
Issue
- JDK-8218745: TableView: visual glitch at borders on horizontal scrolling
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx pull/630/head:pull/630
$ git checkout pull/630
Update a local copy of the PR:
$ git checkout pull/630
$ git pull https://git.openjdk.org/jfx pull/630/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 630
View PR using the GUI difftool:
$ git pr show -t 630
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/630.diff
:wave: Welcome back mhanl! A progress list of the required criteria for merging this PR into master
will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.
/reviewers 2
@kevinrushforth The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).
@Maran23 this pull request can not be integrated into master
due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:
git checkout 8218745-snapping-x-y-tableview-scroll
git fetch https://git.openjdk.java.net/jfx master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push
@Maran23 This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!
@Maran23 This pull request has been inactive for more than 16 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open
pull request command.