RFR: 8279614: The left line of the TitledBorder is not painted on 150 scale factor [v7]

Sergey Bylokhov serb at openjdk.java.net
Tue Mar 29 23:39:41 UTC 2022


On Wed, 23 Mar 2022 18:24:05 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:
> 
>   scale stroke width at higher scalings

I think the only way to fix such an issue is to use a raster-based API which will work as "usually expected" when the UI is scaled unlike vectors like drawLine/etc, an example of a similar bug https://mail.openjdk.java.net/pipermail/swing-dev/2014-April/003352.html
As far as I remember the best solution(used by the javafx) is to draw layers by the fillArea(shadow area->then border area->then component area), I am not sure it will be much slower.
Another solution is to draw the "lines" using the fillRect, but it might cause some issues in the corners if the line color is transparent

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

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



More information about the client-libs-dev mailing list