RFR: 8185887: TableRowSkinBase fails to correctly virtualize cells in horizontal direction [v4]
yosbits
github.com+7517141+yososs at openjdk.java.net
Wed Sep 9 02:50:59 UTC 2020
On Tue, 8 Sep 2020 20:19:13 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> Column virtualization causes shortness of breath when scrolling a large stroke horizontally.
>> This does not happen when stroking on the scrollbar. Looks like a potential problem with VirtualFlow.
>>
>> If you are worried about shortness of breath, the following code will help reduce the problem.
>>
>>
>> Java
>> private static final int OVERLAP_MARGIN = 500;
>>
>> private static boolean isOverlap(double start, double end, double start2, double end2){
>> start = Math.max(start-OVERLAP_MARGIN, start2);
>> end = Math.min(end+OVERLAP_MARGIN, end2);
>> return (start<=end2 && end >= start2);
>> }
>
> @yososs Per [this message](https://mail.openjdk.java.net/pipermail/openjfx-dev/2020-September/027534.html) on the
> openjfx-dev mailing list, I have closed [JDK-8185886](https://bugs.openjdk.java.net/browse/JDK-8185886) as a duplicate,
> and suggested another existing JBS issue for this PR to use. Please change the title to: 8185887: TableRowSkinBase
> fails to correctly virtualize cells in horizontal direction
Below are the answers to JBS's suggestions.
> The patch below resolves the issue, but it is not likely the correct solution (we are trying to determine the table
> width, but we are getting the width and padding on the underlying virtualflow (the width is fine, the padding should
> really come from tableview directly):
You probably mention this part,
At least padding refers to Skinnable(TableView or TreeTableView). This is the same as before (L683). The width of
VirtualFlow is determined by the header of Table.
modules/javafx.controls/src/main/java/javafx/scene/control/skin/TableRowSkinBase.java#L360-L365
Java
final VirtualFlow<?> virtualFlow = getVirtualFlow();
final double scrollX = virtualFlow == null ? 0.0 : virtualFlow.getHbar().getValue();
final Insets padding = getSkinnable().getPadding();
final double vfWidth = virtualFlow == null ? 0.0:virtualFlow.getWidth();
final double headerWidth = vfWidth - (padding.getLeft() + padding.getRight());
For example, can you assume a case that does not work properly?
-------------
PR: https://git.openjdk.java.net/jfx/pull/125
More information about the openjfx-dev
mailing list