RFR: JDK-8320444: Column drag header is positioned wrong for nested columns [v2]
Marius Hanl
mhanl at openjdk.org
Tue Nov 21 20:03:32 UTC 2023
On Tue, 21 Nov 2023 17:28:26 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> modules/javafx.controls/src/test/java/test/javafx/scene/control/skin/TableViewSkinTest.java line 225:
>>
>>> 223: TableColumnHeaderShim.columnReordering(tableColumnHeader, bounds.getMinX() + 20, bounds.getMinY());
>>> 224:
>>> 225: // 200, since we have 2 columns to the left with a size of 100.
>>
>> Can you also add why assertion is done for 220 in this comment?
>
> good point.
>
> May I suggest to declare constants for column widths and column reordering coordinates so the origin of these numbers becomes clear?
> Also, we are comparing floating point numbers, so perhaps it's better specify a small delta:
>
> double CWIDTH = 100;
> double EPSILON = 0.0001;
> assertEquals(CWIDTH + CWIDTH + OFFSET, columnDragHeader.getTranslateX(), EPSILON);
Pushed.
Since we compare very simple numbers (we even set them before as int), I personally would not expect a delta but an accurate number, therefore no delta added in this test.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1292#discussion_r1401106069
More information about the openjfx-dev
mailing list