You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by OmPrakash Muppirala <bi...@gmail.com> on 2015/01/01 00:00:33 UTC
How does a skin know that its hostcomponent size has changed
I am seeing that in the updateDisplayList() method of my BusyIndicator
skin, the unscaledWidth and unscaledHeight are showing up as 0. Even
hostComponent.width and hostComponent.height show up as 0.
But hostComponent.$height and hostComponent.$width show the correct values.
It looks like I might be missing something in the component <-> skin
contract. How does a skin know that a component has a new width and height?
This is one the reasons the BusyIndicator mustella tests are failing.
Anyone has insights on what could be happening here?
Thanks,
Om
Re: How does a skin know that its hostcomponent size has changed
Posted by Alex Harui <ah...@adobe.com>.
In looking at the code, unless explicitly sized, SkinnableComponent will
get sized to the measuredWidth/Height of its skin.
If the skin defers its content, then the measurement might take place
before the content defines the size in $width/$height. Or a subcomponent
might get sized to 0 regardless of its content.
HTH,
-Alex
On 12/31/14, 8:44 PM, "OmPrakash Muppirala" <bi...@gmail.com> wrote:
>On Dec 31, 2014 3:30 PM, "Harbs" <ha...@gmail.com> wrote:
>>
>> I think the width and height are set by the skin, and the host component
>size is inferred from that.
>
>The failing tests are setting the BI's width and height, which does not
>seem to propagate to the skin, at least in the test.
>
>>
>> See Skin.as explicit min and max values and SkinableComponent.measure()
>>
>> Also, updateDisplayList() in SkinnableComponent calls setActualSize() on
>the skin.
>
>As I am debugging through the tests, the values on these methods are
>showing up as 0, which is what is so confusing.
>
>Thanks for taking the time to respond!
>
>Regards,
>Om
>
>>
>> Does that help?
>>
>> On Jan 1, 2015, at 1:00 AM, OmPrakash Muppirala <bi...@gmail.com>
>wrote:
>>
>> > I am seeing that in the updateDisplayList() method of my BusyIndicator
>> > skin, the unscaledWidth and unscaledHeight are showing up as 0. Even
>> > hostComponent.width and hostComponent.height show up as 0.
>> >
>> > But hostComponent.$height and hostComponent.$width show the correct
>values.
>> >
>> >
>> > It looks like I might be missing something in the component <-> skin
>> > contract. How does a skin know that a component has a new width and
>height?
>> >
>> > This is one the reasons the BusyIndicator mustella tests are failing.
>> > Anyone has insights on what could be happening here?
>> >
>> > Thanks,
>> > Om
>>
Re: How does a skin know that its hostcomponent size has changed
Posted by OmPrakash Muppirala <bi...@gmail.com>.
On Dec 31, 2014 3:30 PM, "Harbs" <ha...@gmail.com> wrote:
>
> I think the width and height are set by the skin, and the host component
size is inferred from that.
The failing tests are setting the BI's width and height, which does not
seem to propagate to the skin, at least in the test.
>
> See Skin.as explicit min and max values and SkinableComponent.measure()
>
> Also, updateDisplayList() in SkinnableComponent calls setActualSize() on
the skin.
As I am debugging through the tests, the values on these methods are
showing up as 0, which is what is so confusing.
Thanks for taking the time to respond!
Regards,
Om
>
> Does that help?
>
> On Jan 1, 2015, at 1:00 AM, OmPrakash Muppirala <bi...@gmail.com>
wrote:
>
> > I am seeing that in the updateDisplayList() method of my BusyIndicator
> > skin, the unscaledWidth and unscaledHeight are showing up as 0. Even
> > hostComponent.width and hostComponent.height show up as 0.
> >
> > But hostComponent.$height and hostComponent.$width show the correct
values.
> >
> >
> > It looks like I might be missing something in the component <-> skin
> > contract. How does a skin know that a component has a new width and
height?
> >
> > This is one the reasons the BusyIndicator mustella tests are failing.
> > Anyone has insights on what could be happening here?
> >
> > Thanks,
> > Om
>
Re: How does a skin know that its hostcomponent size has changed
Posted by Harbs <ha...@gmail.com>.
I think the width and height are set by the skin, and the host component size is inferred from that.
See Skin.as explicit min and max values and SkinableComponent.measure()
Also, updateDisplayList() in SkinnableComponent calls setActualSize() on the skin.
Does that help?
On Jan 1, 2015, at 1:00 AM, OmPrakash Muppirala <bi...@gmail.com> wrote:
> I am seeing that in the updateDisplayList() method of my BusyIndicator
> skin, the unscaledWidth and unscaledHeight are showing up as 0. Even
> hostComponent.width and hostComponent.height show up as 0.
>
> But hostComponent.$height and hostComponent.$width show the correct values.
>
>
> It looks like I might be missing something in the component <-> skin
> contract. How does a skin know that a component has a new width and height?
>
> This is one the reasons the BusyIndicator mustella tests are failing.
> Anyone has insights on what could be happening here?
>
> Thanks,
> Om