<Swing Dev> [10] RFR JDK-8178025:HiDPI with non-integer scale factor - SPANs in HTML are rendered overlapping each other
Semyon Sadetsky
semyon.sadetsky at oracle.com
Wed Oct 11 17:20:17 UTC 2017
+1
--Semyon
On 10/11/2017 02:43 AM, Prasanta Sadhukhan wrote:
> Hi All,
>
> Please review a fix for an issue whereby, when using a non-integer
> resolution (e.g. 225%) for a HiDPI display,
> the Swing HTML rendering incorrectly calculates the width of SPAN
> elements which results in SPANs being
> incorrectly positioned and overlapping with each other.
>
> Issue was, when a JLabel with an html text is created, the
> GlyphPainter1.getSpan() uses a FontrenderedContext with transform scale 1
> and also the obtained width is converted to int and not to float.
>
> Proposed fix is to use correct transform while calculating the string
> width and also use floating point API to get floating point width.
>
> webrev:http://cr.openjdk.java.net/~psadhukhan/8178025/webrev.00/
> Bug: https://bugs.openjdk.java.net/browse/JDK-8178025
>
> Regards
> Prasanta
More information about the swing-dev
mailing list