RFR: 8090123: Items are no longer visible when collection is changed [v7]
Kevin Rushforth
kcr at openjdk.org
Tue Mar 7 13:36:40 UTC 2023
On Tue, 7 Mar 2023 07:18:07 GMT, Karthik P K <kpk at openjdk.org> 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
More information about the openjfx-dev
mailing list