<Swing Dev> [13] RFR JDK-8212904:JTextArea line wrapping incorrect when using UI scale
Prasanta Sadhukhan
prasanta.sadhukhan at oracle.com
Fri Mar 22 05:34:27 UTC 2019
Hi Sergey,
Thanks for your review. textarea.getLineCount() returns same number for
both correct and broken wrap so it cannot be used for test automation...
Regards
Prasanta
On 21-Mar-19 4:24 AM, Sergey Bylokhov wrote:
> 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
>
>
More information about the swing-dev
mailing list