<Swing Dev> RFR JDK-8226464:TitledBorder label appears cut off on hidpi devices

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Wed Apr 15 12:52:20 UTC 2020


Hi All,

Please review a fix for an issue where it is seen that the 
TitledBorderLabel is cutoff for uiScale>1.25 for SynthLookAndFeel.

It is found that in BasicLabelUI, used for other L&Fs,where the issue is 
not seen, the paint() method calls 
layout()=>SwingUtilities.layoutCompoundLabel() to get the clipped 
version of the label string

but SynthLabelUI#paint calls SynthGraphicsUtils#paintText which calls 
layoutText() which also used SwingUtilities.layoutCompoundLabel() to get 
the clipped version of the label string but still it additionally does 
its own clipping using text bounds.

This bounds is passed in both Basic L&F and Synth L&F via 
paintEnabledText() and paintText() respectively to 
SwingUtilities2.drawStringUnderlineCharAt() to drawthe string, so only 
additional clipping done in SynthL&F is the cause of the problem.

Proposed fix is to remove this additional clipping in SynthL&F.

Bug: https://bugs.openjdk.java.net/browse/JDK-8226464

webrev: http://cr.openjdk.java.net/~psadhukhan/8226464/webrev.0/

Regards
Prasanta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20200415/6459a71f/attachment.htm>


More information about the swing-dev mailing list