<Swing Dev> [10] RFR JDK-8178025:HiDPI with non-integer scale factor - SPANs in HTML are rendered overlapping each other

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Tue Oct 31 06:12:06 UTC 2017


Ok. Modified webrev to make sure data is recalculated by listening to 
"graphicsConfig" change

http://cr.openjdk.java.net/~psadhukhan/8178025/webrev.03/

Regards
Prasanta
On 10/27/2017 11:57 AM, Sergey Bylokhov wrote:
> I am not sure that it is called when the window is moved from one 
> screen(HiDPI) to another screen(lowDpi). In this case the 
> updateGraphicsData() will be called and we need to recalculate our data.
>
> On 23/10/2017 23:06, Prasanta Sadhukhan wrote:
>> Whatever testing I have done, propertyChange gets called during. If 
>> you have any test/steps which changes GC at "later" stage, please 
>> provide and I will see if it does not call propertyChange.
>>
>>
>> On 10/24/2017 11:13 AM, Alan Snyder wrote:
>>> You’re guessing? Really?
>>>
>>>> On Oct 23, 2017, at 10:19 PM, Prasanta Sadhukhan 
>>>> <prasanta.sadhukhan at oracle.com 
>>>> <mailto:prasanta.sadhukhan at oracle.com>> wrote:
>>>>
>>>> I would guess so as "ancestor" listener is to support notification 
>>>> when changes occur to a JComponent or one of its ancestors.
>>>>
>>>> Regards
>>>> Prasanta
>>>> On 10/23/2017 7:45 PM, Alan Snyder wrote:
>>>>> Does it handle the case where the graphics configuration is later 
>>>>> changed?
>>>>>
>>>>>   Alan
>>>>>
>>>>>
>>>>>> On Oct 22, 2017, at 11:23 PM, Prasanta Sadhukhan 
>>>>>> <prasanta.sadhukhan at oracle.com 
>>>>>> <mailto:prasanta.sadhukhan at oracle.com>> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 10/19/2017 3:42 PM, Prasanta Sadhukhan wrote:
>>>>>>>
>>>>>>>
>>>>>>> On 10/19/2017 3:49 AM, Sergey Bylokhov wrote:
>>>>>>>> On 17/10/2017 03:48, Prasanta Sadhukhan wrote:
>>>>>>>>> It seems for JLabel, Component.updateGraphicsData() with 
>>>>>>>>> proper GraphicsConfiguraiton is never called which it does for 
>>>>>>>>> JTextComponent or JDialog. Do you know why? Because of this, 
>>>>>>>>> correct FRC is not created.
>>>>>>>>> I am not sure what else I can do to create correct FRC.
>>>>>>>>
>>>>>>>> But at some point we will get a correct GraphicsConfiguraiton 
>>>>>>>> for a component, right? It should be called for the window and 
>>>>>>>> child when we show the window on the screen, when we move the 
>>>>>>>> window to another screen, etc.
>>>>>>>>
>>>>>>>>
>>>>>>> Yes, it seems to be called when JLabel is added to JFrame but 
>>>>>>> not before.
>>>>>>> Span is calculated in GlyphPainter1.getSpan() which is called 
>>>>>>> when JLabel is created and
>>>>>>> as it seems, not when JLabel is added to JFrame (which is when 
>>>>>>> we get the correct graphics configuration and therefore correct 
>>>>>>> transform).
>>>>>>>
>>>>>>> So, we need to make sure spans are recalculated when the JLabel 
>>>>>>> is added to frame, which is what modified webrev does by calling 
>>>>>>> JLabel.updateUI()
>>>>>>> http://cr.openjdk.java.net/~psadhukhan/8178025/webrev.01/ 
>>>>>>> <http://cr.openjdk.java.net/%7Epsadhukhan/8178025/webrev.01/>
>>>>>>>
>>>>>> Modified webrev to only update html renderer when JLabel is added 
>>>>>> to frame by listening to property "ancestor" which implies 
>>>>>> component is added/made visible, at which point correct graphics 
>>>>>> configuration is set.
>>>>>> http://cr.openjdk.java.net/~psadhukhan/8178025/webrev.02/ 
>>>>>> <http://cr.openjdk.java.net/%7Epsadhukhan/8178025/webrev.02/>
>>>>>>
>>>>>> Regards
>>>>>> Prasanta
>>>>>>> Regards
>>>>>>> Prasana
>>>>>
>>>>
>>>
>>
>
>




More information about the swing-dev mailing list