-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8218745: TableView: visual glitch at borders on horizontal scrolling #1462
base: master
Are you sure you want to change the base?
8218745: TableView: visual glitch at borders on horizontal scrolling #1462
Conversation
👋 Welcome back mhanl! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
I'm reasonably sure there was a good reason for the code in NGNode doing what it did. This will need very careful review and testing before we would accept it. /reviewers 2 reviewers |
@kevinrushforth |
Reviewers: @arapte @andy-goryachev-oracle @Maran23 wait for either @arapte or me to review the proposed Prism changes in this PR. |
100% agree. Thats why I checked the other path and had a closer look what it does, since it still needs to the right for whatever clip is used. And there I saw that is does nearly the same thing, but with the With that in mind, we need to especially check if the fast path did something completely unexpected what the other 'slow' path did not and we may miss now. |
I see a problem on Windows 11 at 125% scale: using the tester app in the ticket, the table focus rectangle's right edge is not visible at some width (i.e. appears and disappears when resizing the window width): When it is visible, there is no jitter described in the ticket. Also, it can be reproduced at 100% scale. It may or may not be a separate issue. |
modules/javafx.graphics/src/test/java/test/com/sun/javafx/sg/prism/NGNodeTest.java
Outdated
Show resolved
Hide resolved
Yeah this is a 'known bug' for me, and has nothing to do with this fix. |
I do not see the issue without the fix though (at the same resolution). |
you are right: I see the focus rectangle jitter at 175% scale on win 11 (w/o the fix), so it must be a different issue. At this scale, it merely shows a thinner line, perhaps that's why I did not notice it earlier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code change looks good, and I can see it fixes the issue on windows with fractional scales.
Thank you for writing multiple test cases!
Yeah exactly, it looks like when the focus rect is on the border of the window, it will sometimes disappear (probably jitter 'out' of the window). |
@Maran23 This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 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 can not be integrated into git checkout 8218745-tableview-glitch-clipping-fix
git fetch https://git.openjdk.org/jfx.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
…tableview-glitch-clipping-fix # Conflicts: # modules/javafx.graphics/src/main/java/com/sun/javafx/sg/prism/NGNode.java
@Maran23 This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 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 8 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 |
I think this PR should be reopened. |
/open |
@Maran23 This pull request is now open |
@arapte could you be a second reviewer? |
@Maran23 please resolve the merge conflict |
…tableview-glitch-clipping-fix # Conflicts: # modules/javafx.controls/src/test/java/test/javafx/scene/control/TableViewTest.java # modules/javafx.controls/src/test/java/test/javafx/scene/control/TreeTableViewTest.java
@Maran23 This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 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 It shows a merge conflict when I tried to merge in the master. Could you please check. |
…tableview-glitch-clipping-fix # Conflicts: # modules/javafx.controls/src/test/java/test/javafx/scene/control/TableViewTest.java # modules/javafx.controls/src/test/java/test/javafx/scene/control/TreeTableViewTest.java # modules/javafx.controls/src/test/java/test/javafx/scene/control/skin/VirtualFlowTest.java # modules/javafx.graphics/src/test/java/test/com/sun/javafx/sg/prism/NGNodeTest.java
Thanks for the ping, resolved now. Hopefully I did not messed up any JUnit Import. 😄 |
Alternative PR to #1330 which does not modify the layout of
VirtualFlow
.This PR fixes the glitching by removing the code in
NGNode.renderRectClip
, which made many calculations leading to floating point errors.Interestingly I found out, that
getClippedBounds(..)
is already returning the correct bounds that just need to be intersected with the clip of theGraphics
object.So the following code is effectively doing the same:
Old:
New:
As you can see, there are very similar, but
getClippedBounds
does a much better job in calculating the bounds.I also wrote a tests proving the bug. I took 100% of the setup and values from a debugging session I did when reproducing this bug.
I checked several scenarios and code and could not find any regressions.
Still, since this is change affects all nodes with rectangular clips, we should be careful.
Performance wise I could not spot any difference, I do not expect any difference.
So I would like to have at least 2 reviewers.
Note that I will do more testing as well soon on all JavaFX applications I have access to.
As written in the other PR, I have some interesting findings on this particular problem.
Copy&Paste from the other PR:
Ok, so I found out the following:
When a Rectangle is used as clip without any effect or opacity modification, the rendering goes another (probably faster) route with rendering the clip. That's why setting the
opacity
to0.99
fixes the issue - another route will be used for the rendering.This happens at the low level (
NGNode
) side of JavaFX....
I could track it down to be a typical floating point problem
...
The bug always appears when I scroll and the clip RectBounds are something like:
RectBounds { minX:6.999996, minY:37.0, maxX:289.00003, maxY:194.0} (w:282.00003, h:157.0)
...
while this does not happen when the value is something like:
RectBounds { minX:7.000004, minY:37.0, maxX:289.0, maxY:194.0} (w:282.0, h:157.0
Even more details:
ClippedContainer
changes itslayoutX
AND thelayoutX
of its clip, the bug only appears theredouble
, while the low level side (NG) usesfloat
mostly, which seems to make things less accurate, although not 100% sure if doubles will avoid this particular problem completely, probably not.I'm not sure why this decision was made.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1462/head:pull/1462
$ git checkout pull/1462
Update a local copy of the PR:
$ git checkout pull/1462
$ git pull https://git.openjdk.org/jfx.git pull/1462/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1462
View PR using the GUI difftool:
$ git pr show -t 1462
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1462.diff
Webrev
Link to Webrev Comment