RFR: 8295078: TextField blurry when inside an TitledPane -> AnchorPane [v5]

Andy Goryachev angorya at openjdk.org
Fri May 12 15:14:59 UTC 2023


On Thu, 11 May 2023 20:25:49 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 with a new target base due to a merge or a rebase. The pull request now contains six commits:
> 
>  - Merge branch 'master' of https://github.com/openjdk/jfx into 8295078-textfield-blurry
>  - 8295078: Snap anchors as well
>  - Merge branch 'master' of https://github.com/openjdk/jfx into 8295078-textfield-blurry
>    
>     Conflicts:
>    	modules/javafx.graphics/src/test/java/test/javafx/scene/layout/AnchorPaneTest.java
>  - 8295078: Replace JUnit4 with Junit5 imports
>  - 8295078: Adjusted Copyright year
>  - 8295078: TextField blurry when inside an TitledPane -> AnchorPane

Thank you @hjohn for a detailed writeup!

I fully agree with the idea of explaining snapping in some form of "application note", let research the subject of where and how we can do that.

I suppose the next step would be to review other layouts to see if they fail with snapping, especially with fractional scale (hm, HBox).

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

Marked as reviewed by angorya (Reviewer).

PR Review: https://git.openjdk.org/jfx/pull/910#pullrequestreview-1424706254


More information about the openjfx-dev mailing list