<Swing Dev> [13] RFR JDK-8212904:JTextArea line wrapping incorrect when using UI scale
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Wed Mar 20 22:54:47 UTC 2019
Hi, Prasanta.
The change looks fine, but probably the test can be automated? I guess when "wrap" works properly you should get more lines in the text area, than in case of broken "wrap"?
On 19/03/2019 00:03, Prasanta Sadhukhan wrote:
> Hi All,
>
> Please review a fix for an issue where it is seen that
> line wrapping of JTextArea doen't work correctly if you set wrapStyleWord = true and you use a UI scale (either by setting "sun.java2d.uiScale" or by setting display scale of Windows)
>
> It is a regression of JDK-8132119: Provide public API for text related methods in SwingUtilities2
> where many public text related API was added catering to floating point hidpi scale.
> This issue happened because of that as the public Utilities.getBreakLocation() API, used to determine where to break the given text, is using non-floating point methods.
>
> Proposed fix is to make sure correct getBreakLocation() method is called and not the deprecated(integer based) one
> and also the floating point based getBreakLocation() API uses floating point API based calculations.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8212904
> webrev: http://cr.openjdk.java.net/~psadhukhan/8212904/webrev.0/
>
> Regards
> Prasanta
--
Best regards, Sergey.
More information about the swing-dev
mailing list