RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v11]
Harshitha Onkar
honkar at openjdk.org
Fri Oct 21 22:40:24 UTC 2022
On Fri, 21 Oct 2022 22:21:09 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:
>> JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614)
>>
>> The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame.
>>
>> 
>
> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision:
>
> new x,y and translate component added to fix pixel painting issue
While testing, following issues were observed -
- Uneven border thickness (no. of pixels painted differed on 4 sides) thus making it difficult to evenly place the shadow and highlight lines - This was resolved by using an even multiplier (4) for border thickness instead of odd (5) and changing border insets to same number (4).
- Edges of border being painted over background and titlebar resolved by using even multiplier
- Shadow and highlight line painted at different offsets at left and bottom of the border even though the start location was same - Adding scaled x, y and respective translate to the scaled width and height as suggested by @aivanov-jdk helped to achieve consistent placement of the lines on all scales.
w = clipRound(at.getScaleX() * width + xx) - xtranslation;
h = clipRound(at.getScaleY() * height + yy) - ytranslation;
-------------
PR: https://git.openjdk.org/jdk/pull/10274
More information about the client-libs-dev
mailing list