RFR: 8295078: TextField blurry when inside an TitledPane -> AnchorPane [v3]
Kevin Rushforth
kcr at openjdk.org
Wed Nov 9 19:38:38 UTC 2022
On Thu, 3 Nov 2022 21:21:42 GMT, Marius Hanl <mhanl at openjdk.org> wrote:
>> The problem here is, that the `AnchorPane` does not use its snapped insets.
>> Therefore, the fix is to replace all `getInsets().getXXX` calls with their corresponding `snappedXXXInset()` methods.
>>
>> Note: The reason the `AnchorPane` inside a `TitledPane` is blurry in the first place is because a `TitledPane` applies padding to its content.
>> Line 2995 in `modena.css`:
>>
>> .titled-pane > .content > AnchorPane {
>> -fx-padding: 0.8em;
>> }
>>
>> which translates to 9.6px.
>>
>> EDIT: This is btw a good example of the JUnit 5 feature `@ParameterizedTest` with `@ValueSource`
>
> Marius Hanl has updated the pull request incrementally with one additional commit since the last revision:
>
> 8295078: Replace JUnit4 with Junit5 imports
Not a complete review, but I did leave some inline comments. I note that there is precedent for using the snapped insets in intermediate computations, so that part of the change seems OK to me. If that is going to be the pattern, you need to make sure that you are snapping the values you add to the snapped insets.
I'd like @arapte to take a closer look as well.
modules/javafx.graphics/src/main/java/javafx/scene/layout/AnchorPane.java line 283:
> 281: }
> 282:
> 283: return snappedLeftInset() + max + snappedRightInset();
Have you verified that `max` ends up as a snapped value in all cases? Some of the values that are used in the computation of max clearly are snapped, such as `computeChildPrefAreaWidth` (which is a method in the Region superclass that returns a snapped result), but others might not be.
-------------
PR: https://git.openjdk.org/jfx/pull/910
More information about the openjfx-dev
mailing list