<Swing Dev> [13] RFR JDK-8212904:JTextArea line wrapping incorrect when using UI scale
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Fri Mar 22 23:32:32 UTC 2019
On 21/03/2019 22:34, Prasanta Sadhukhan wrote:
> Thanks for your review. textarea.getLineCount() returns same number for both correct and broken wrap so it cannot be used for test automation...
Then probably it can be checked by the visibility of the horizontal scroll bar?
If you set the scrollbar policy as HORIZONTAL_SCROLLBAR_AS_NEEDED then you can check is it visible(wrap-off) or is it invisible(wrap-on).
Or you can check the height of the text area, which is different when wrap on/off.
> 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
>>
>>
>
--
Best regards, Sergey.
More information about the swing-dev
mailing list