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

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Thu Apr 16 03:32:53 UTC 2020


Yes, 8075918 fix also works ok with this fix as I can see.

Regards
Prasanta
On 15-Apr-20 10:37 PM, Sergey Bylokhov wrote:
> Hi, Prasanta.
>
> That additional clipping was added as part of JDK-8075918, can you 
> please confirm that JDK-8075918 fix will not be broken by the current 
> one.
>
> On 4/15/20 5:52 am, Prasanta Sadhukhan wrote:
>> 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
>
>


More information about the swing-dev mailing list