RFR: 8218745: TableView: visual glitch at borders on horizontal scrolling [v2]
Marius Hanl
mhanl at openjdk.org
Mon Aug 15 17:02:36 UTC 2022
> 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.
>
> ---
> 1.
> 
> ---
> 2.
> 
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
Conflicts:
modules/javafx.controls/src/test/java/test/javafx/scene/control/TableViewTest.java
modules/javafx.controls/src/test/java/test/javafx/scene/control/skin/VirtualFlowTest.java
- 8218745: Snapping X/Y when scrolling
-------------
Changes: https://git.openjdk.org/jfx/pull/630/files
Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=630&range=01
Stats: 60 lines in 6 files changed: 56 ins; 0 del; 4 mod
Patch: https://git.openjdk.org/jfx/pull/630.diff
Fetch: git fetch https://git.openjdk.org/jfx pull/630/head:pull/630
PR: https://git.openjdk.org/jfx/pull/630
More information about the openjfx-dev
mailing list