RFR: 8264591: HBox/VBox child widths pixel-snap to wrong value [v6]

Michael Strauß mstrauss at openjdk.org
Tue Jan 3 06:31:41 UTC 2023


On Sun, 11 Sep 2022 21:10:50 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

>> Michael Strauß has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 10 commits:
>> 
>>  - Merge branch 'openjdk:master' into fixes/box-snap-to-pixel
>>  - revert snappedSum
>>  - don't call snappedSum in hot loop
>>  - Improved code documentation
>>  - Merge branch 'master' into fixes/box-snap-to-pixel
>>  - changed some method names, make test config a local class
>>  - added documentation, improved method names
>>  - Merge branch 'master' into fixes/box-snap-to-pixel
>>  - Fix pixel-snapping glitches in VBox/HBox
>>  - Failing test
>
> modules/javafx.graphics/src/test/java/test/javafx/scene/layout/VBoxTest.java line 804:
> 
>> 802:      */
>> 803:     @Test public void testPixelSnappedContentHeightIsSameAsBoxHeight() {
>> 804:         class testPixelSnapConfig {
> 
> should be `TestPixelSnapConfig`. 
> And I think for the sake of testing, this can be a standalone class or inner class as well

I've renamed the class. Since it is not reusable and only relevant within this single test, I think it's okay to leave it as a local class.

> modules/javafx.graphics/src/test/java/test/javafx/scene/layout/VBoxTest.java line 819:
> 
>> 817:             // For these tests, VBox.prefHeight is specified, so we expect the final height to be exactly that.
>> 818:             // Child heights will be adjusted appropriately such that the sum of child widths corresponds to VBox.prefHeight.
>> 819:             new testPixelSnapConfig(76.0, 1.0, true),
> 
> I would prefer the initialization of the array before looping so the code looks more clean

Done.

-------------

PR: https://git.openjdk.org/jfx/pull/445


More information about the openjfx-dev mailing list