RFR: 8015854: [macosx] JButton's HTML ImageView adding unwanted padding [v4]

Alexey Ivanov aivanov at openjdk.java.net
Tue Mar 1 12:25:09 UTC 2022


On Thu, 24 Feb 2022 16:07:41 GMT, DamonGuy <duke at openjdk.java.net> wrote:

>> src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java line 313:
>> 
>>> 311:             // use zero insets for view since layout only handles text calculations
>>> 312:             text = layoutAndGetText(g, b, aquaBorder, new
>>> 313:                     Insets(0,0,0,0), viewRect, iconRect, textRect);
>> 
>> If there is only html text instead of image in JButton, will it not be a problem using 0 insets or is there a problem with text too being shifted like image?
>
> The text was also unexpectedly shifted, so this zero inset fixes that issue as well. Setting the insets to zero for all HTML fixes the unwanted padding.

Should we create a separate test for HTML text? Probably manual only but still. If it is a known issue and it's also resolved by this fix, I find such a test useful.

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

PR: https://git.openjdk.java.net/jdk/pull/7310



More information about the client-libs-dev mailing list