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

DamonGuy duke at openjdk.java.net
Thu Feb 24 16:17:05 UTC 2022


On Thu, 24 Feb 2022 09:31:57 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> DamonGuy has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fixed incomplete comment.
>
> test/jdk/javax/swing/JButton/HtmlButtonImageTest/HtmlButtonImageTest.java line 93:
> 
>> 91:         Color rightClr = robot.getPixelColor(point.x + (SQUARE_WIDTH/2) - PIXEL_BUFFER, point.y);
>> 92:         Color topClr = robot.getPixelColor(point.x, point.y - (SQUARE_HEIGHT/2) + PIXEL_BUFFER);
>> 93:         Color botClr = robot.getPixelColor(point.x, point.y + (SQUARE_HEIGHT/2) - PIXEL_BUFFER);
> 
> there was an issue of using getPixelColor on retina screen on mac laptop as @honkar-jdk  found out in #[7219](https://git.openjdk.java.net/jdk/pull/7219)..She has to use BufferedImage..Are you sure this is working on all mac CI system, mac external monitor and mac laptop?

Initially, I ran into this issue as well a few weeks ago when I made the test. My solution was to check for redness by checking for 250 or greater R values with 10 or less G and B values instead of checking for exactly 255,0,0. When tested in mach5, some Macs failed with values that had pixels that fit within this color range, but wasn't exactly 255,0,0.

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

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



More information about the client-libs-dev mailing list