RFR: 8218745: TableView: visual glitch at borders on horizontal scrolling [v2]
Marius Hanl
mhanl at openjdk.org
Thu May 23 12:56:22 UTC 2024
> This PR fixes the border glitch/gap as explained in both linked tickets.
>
> I noted that the `ScrollPane` control does not suffer from this problem, although the code is mostly the same as in `VirtualFlow`. The `ScrollPane` snaps the content correctly, no matter which scale. I carefully checked the code and it seems that the container structure in `ScrollPane` was explicitly written to handle this perfectly. There was definitely some thought on that.
>
> So to finally fix this issue, I rewrote the `VirtualFlow` container/scrolling code to be **exactly** the same as in `ScrollPane`(Skin).
> And this also fixes the issue, while behaving the same as before.
>
> In the future it may makes sense to try to somewhat unify the code from `ScrollPane` and `VirtualFlow`. I already have some ideas.
>
> Unfortunately though, one more container is introduced to `VirtualFlow`, so the css needs to be changed since it is very strictly written in the first place:
> Before: `.list-view:focused > .virtual-flow > .clipped-container > .sheet > .list-cell`
> After: `.list-view:focused > .virtual-flow > .viewport > .clipped-container > .sheet > .list-cell`
>
> To better understand this, the container structure (tree) is shown below:
>
> - ScrollPane
> - viewRect -> `setClip` -> clipRect (viewContent size)
> - viewContent -> `setLayoutX`
> - Content
> - vsb
> - hsb
> - corner
>
> ---
> - VirtualFlow
> - viewRect **(->NEW IN THIS PR<-)** -> `setClip` -> clipRect (clippedContainer size)
> - clippedContainer/clipView -> `setLayoutX` (when scrolling)
> - sheet
> - Cell
> - vsb
> - hsb
> - corner
Marius Hanl has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:
- Merge branch 'master' of https://github.com/openjdk/jfx into 8218745-snapping-x-y-tableview-scroll-3
# 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
- JDK-8218745: TableView: visual glitch at borders on horizontal scrolling
-------------
Changes: https://git.openjdk.org/jfx/pull/1330/files
Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1330&range=01
Stats: 306 lines in 14 files changed: 122 ins; 41 del; 143 mod
Patch: https://git.openjdk.org/jfx/pull/1330.diff
Fetch: git fetch https://git.openjdk.org/jfx.git pull/1330/head:pull/1330
PR: https://git.openjdk.org/jfx/pull/1330
More information about the openjfx-dev
mailing list