RFR: 8349188: LineBorder does not scale correctly [v3]
Sergey Bylokhov
serb at openjdk.org
Mon Jun 30 16:26:43 UTC 2025
On Mon, 30 Jun 2025 15:05:55 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> @mrserb Putting the discussions aside, does the suggested fix look good to you?
>>
>> As I said, border painting uses `clipRound` consistently: both in coordinate calculation and in thickness calculation. This approach resolves the problem reported.
>>
>> Looking at descriptions of `clipScale` and `clipRound`, it seems the former suits better… Yet it makes the rendering less consistent with other borders: using `clipScale` switches to 2-pixel and 3-pixel border at 1.50 and 2.50 correspondingly (from 1 and 2 with `clipRound`). In other cases, the border thickness also increases, which may be undesirable.
>>
>> Overall, there are 6 failures of the `ScaledLineBorderTest.java` test when the code in JDK uses `clipScale` instead of `clipRound`.
>
> I looked at another test case Rajat and I discussed, and using `clipScale` doesn't help there either. I prefer rendering with `clipRound`.
My point is to investigate the difference between clipScale and clipRound to ensure the correct one is used. There was a complex discussion before about similar issue, which is why we currently have two separate versions of this rounding logic. Simply replacing one with the other might not work and some other tweaks should be done.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26025#discussion_r2175466296
More information about the client-libs-dev
mailing list