RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4]

Harshitha Onkar honkar at openjdk.org
Mon Oct 3 22:46:54 UTC 2022


On Mon, 3 Oct 2022 22:02:34 GMT, Alisen Chung <achung at openjdk.org> wrote:

>> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   removed redundant jtreg header
>
> src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 329:
> 
>> 327: 
>> 328:             // Draw the bulk of the border
>> 329:             for (int i = 1; i <= loopCount; i++) {
> 
> Should we redo the drawing of this border to use Graphics2D fillRect instead?

Since loopCount won't be really large,(it is 15 for 300% scaling) and it wouldn't affect the performance drastically,I have retained the original code.

> src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 336:
> 
>> 334:                 // Draw the Long highlight lines
>> 335:                 g.setColor(highlight);
>> 336:                 g.drawLine(scaledCorner + 1, midPoint+stkWidth,
> 
> The spacing here and when drawing shadow lines is a bit inconsistent

@alisenchung  I tried by increasing and decreasing the line position a bit, the current combination provided the optimal positioning of both the shadow and highlight line within the border for all the scales. The slight inconsistency in spacing is probably due to rounding losses in loop count, stroke width and corner. I'll check it again.

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

PR: https://git.openjdk.org/jdk/pull/10274



More information about the client-libs-dev mailing list