RFR: 8279614: The left line of the TitledBorder is not painted on 150 scale factor [v24]
Alexey Ivanov
aivanov at openjdk.java.net
Wed Jun 8 21:32:53 UTC 2022
On Wed, 8 Jun 2022 18:37:55 GMT, Alisen Chung <achung at openjdk.org> wrote:
>> Changed the drawing area to be increased by 0.5 on the left side to prevent clipping
>
> Alisen Chung has updated the pull request incrementally with one additional commit since the last revision:
>
> fixed declarations
Changes requested by aivanov (Reviewer).
src/java.desktop/share/classes/javax/swing/border/EtchedBorder.java line 173:
> 171: }
> 172: RenderingHints rend =
> 173: new RenderingHints(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
If using `VALUE_STROKE_PURE` changes nothing, should it be removed then?
Moreover, the hints aren't applied to anything.
src/java.desktop/share/classes/javax/swing/border/EtchedBorder.java line 204:
> 202:
> 203: // Set the transform we removed earlier
> 204: if (g instanceof Graphics2D) {
The condition should be
Suggestion:
if (resetTransform) {
If `resetTransform` is `true`, then `g` is an instance of `Graphics2D`.
If `resetTransform` is `false`, there's nothing to restore anyway.
test/jdk/javax/swing/border/EtchedBorder/ScaledEtchedBorderTest.java line 44:
> 42: * @bug 8279614
> 43: * @summary The left line of the TitledBorder is not painted on 150 scale factor
> 44: * @requires (os.family == "windows")
It's still unclear to me whether we leave the requirement for Windows only or remove it. It came up a few times but no clear decision has been taken.
The change is not Windows-specific, the test is not Windows-specific, it can be run on other platforms. However, fractional UI scales aren't supported on other platforms but Windows; at the same time, applying fractional scales to `Graphics` when painting to a `BufferedImage` is supported.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7449
More information about the client-libs-dev
mailing list