<Swing Dev> RFR: 8160720: [TEST_BUG] javax/swing/SwingUtilities/TestBadBreak/TestBadBreak.java
Alexey Ivanov
aivanov at openjdk.java.net
Thu Feb 11 21:13:37 UTC 2021
On Wed, 10 Feb 2021 10:33:03 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
> Test hardcodes bufferedimage and frame bounds so it does not capture correct size if scaling factor is used.
> The solution is to always use the same uiscale=1, an updated test still can reproduce the JDK-8015085 issue without fix. Additionally, moved the frame to centre of screen for better mach5 stability.
> Mach5 job running for several iterations on all platforms is ok. Link in JBS.
I think the test does something wrong. Now I see how `uiScale` affects rendering. The test does not paint JLabel directly to the image but rather in its overridden `paintComponent`. So `uiScale` controls the size of the component or rather where the break occurs.
For me on Windows with 200% scaling, in the first image ‘…’ is painted over the transparent background whereas in the second image ‘…’ is over the components opaque background.
The test passes with `uiScale=1` but I see no ‘…’ at all. Both images are clipped at “.1”.
As far as I understand, the purpose of the test is to make sure combining diacritics does not affect string clipping, and it occurs at the same position whether a composite character is used of a decomposed one. Yet no clipping occurs at all with `uiScale=1`. This looks wrong even though the test passes successfully. And when the test fails with `uiScale=2`, the images suggest there's a product bug because the string is clipped differently.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2502
More information about the swing-dev
mailing list