On Tue, 14 Feb 2023 02:27:58 GMT, Harshitha Onkar <[email protected]> wrote:
>> Previous fix to HTML in AquaButtonUI fixed spacing issue for HTML images in
>> a JButton in Aqua L&F. The new issue comes from having text inside the HTML
>> as the button's text. If an icon is used, this icon exceeds the bounds of
>> the button and overlaps the border.
>>
>> Added additional logic to check if HTML contains an img. If so, apply the
>> previous fix. Otherwise, the original implementation for Aqua's JButton HTML
>> layout works correctly, so use this behavior.
>>
>> Added a test based on the provided test in the bug report. Automated the
>> test using a BufferedImage and changed the icon color to RED. Tested with
>> multiple runs on Aqua L&F, and the test passes with the update where it
>> fails without the update.
>
> test/jdk/javax/swing/JButton/HtmlButtonWithTextAndIcon.java line 50:
>
>> 48: import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
>> 49:
>> 50: public class HtmlButtonWithTextAndIcon {
>
> Would it be a good idea to combine `HtmlButtonWithTextAndIcon` &
> `HtmlButtonImageTest` into one comprehensive test, since they are similar?
> This would also make sure that all the cases related to JButton's HTML
> ImageView are available at one place.
I think it's OK from my perspective to have separate tests here because one
relates to an icon while the other handles HTML images.
-------------
PR: https://git.openjdk.org/jdk/pull/12520