On Tue, 7 Mar 2023 07:18:07 GMT, Karthik P K <[email protected]> wrote:
>> tests/system/src/test/java/test/robot/javafx/scene/ChoiceBoxScrollUpOnCollectionChangeTest.java
>> line 144:
>>
>>> 142: double rowHeight =
>>> ContextMenuContentShim.getContextMenuRowHeight(popup);
>>> 143: double screenHeight =
>>> Screen.getPrimary().getBounds().getHeight();
>>> 144: scrollChoiceBox((int) (screenHeight / rowHeight));
>>
>> This seems to work, but it might be more robust to use `Math.ceil()` before
>> casting to int, especially if you make the change to use the visual bounds.
>
> Updated code to use `Math.ceil()`
The `Math.ceil` is in the wrong place. It's the result of the division that
will generate the fractional result that needs it:
double screenHeight = Screen.getPrimary().getVisualBounds().getHeight();
scrollChoiceBox((int) Math.ceil(screenHeight / rowHeight));
-------------
PR: https://git.openjdk.org/jfx/pull/1039