<Swing Dev> [13] RFR JDK-8213535:Windows HiDPI html lightweight tooltips are truncated

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Fri Dec 6 04:20:22 UTC 2019


Gentle reminder....

On 28-Nov-19 3:52 PM, Prasanta Sadhukhan wrote:
> Hi Sergey,
>
> Hi Sergey,
> On 27-Jul-19 2:56 AM, Sergey Bylokhov wrote:
>> Hi, Prasanta.
>> On 01.07.2019 03:25, Prasanta Sadhukhan wrote:
>>>>>> Currently this rectangle is created based on the size of the 
>>>>>> component, so this rectangle is smaller that the size.
>>>>>> But it looks like after the fix the rectangle will be bigger. 
>>>>>> Probably the bug exists in getPreferredSize() where we return 
>>>>>> small size?
>>>>>>
>>> I have modified the fix to scale the size in getPreferredSize() as 
>>> asked.
>>> http://cr.openjdk.java.net/~psadhukhan/8213535/webrev.1/
>>
>> If I am not missing something then BasicToolTipUI.getPreferredSize() 
>> is based on View.getPreferredSpan(). And it looks like the View 
>> actually responsible to draw the actual text. I guess the View should 
>> know what is the correct preferred size of the text. If the size of 
>> the View is outdated then probably we need to reset it?
>>
>> For example take a look to the BasicButtonUI class it uses the 
>> similar logic on top of View, but we reset the view if font, or font 
>> transform is changed see JDK-8201552 and 
>> BasicButtonListener.propertyChange()
>>
> BasicToolTipUI.propertyChange was already changed by 8201552 to update 
> the view if "scale" is changed but the problem still exists so it 
> means View does not know about the correct preferred size of text, so 
> we need the above patch to make it work.
>
> Regards
>
> Prasanta
>


More information about the swing-dev mailing list