<Swing Dev> [13] RFR JDK-8213535:Windows HiDPI html lightweight tooltips are truncated
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Fri Jul 26 21:26:09 UTC 2019
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()
--
Best regards, Sergey.
More information about the swing-dev
mailing list