Re: Can't get custom component to size down properly

2016-10-19 Thread kamcknig
Never mind, I was able to figure it out by doing this:





--
View this message in context: 
http://apache-flex-users.246.n4.nabble.com/Can-t-get-custom-component-to-size-down-properly-tp13841p13858.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: Can't get custom component to size down properly

2016-10-19 Thread kamcknig
Oh my! You did it! Thanks so much!

Sorry though, how would I set the width and height of the Rect to the width
and height a user might set on the component? I tried setting
_fillRect.width/height within the updateDisplayList() override method
instead of setting the top/right/bottom/left in the createChildren() method
but that breaks it.



--
View this message in context: 
http://apache-flex-users.246.n4.nabble.com/Can-t-get-custom-component-to-size-down-properly-tp13841p13857.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: Can't get custom component to size down properly

2016-10-18 Thread Clint M
Does this work for you?


http://ns.adobe.com/mxml/2009";
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="100%"
height="100%">






On Tue, Oct 18, 2016 at 12:31 PM, kamcknig  wrote:

> I think it has something to do with the fact that I'm setting the
> measuredMinWidth in the measure() method. So when sizing down, it's looking
> at the measuredMinWidth and it can't size it down below that. But if I take
> that out then my app runs forever. And continues to grow in width/height
> non-stop and i have to end the process to get it to stop updating
>
>
>
> --
> View this message in context: http://apache-flex-users.
> 246.n4.nabble.com/Can-t-get-custom-component-to-size-
> down-properly-tp13841p13842.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>


Re: Can't get custom component to size down properly

2016-10-18 Thread kamcknig
I think it has something to do with the fact that I'm setting the
measuredMinWidth in the measure() method. So when sizing down, it's looking
at the measuredMinWidth and it can't size it down below that. But if I take
that out then my app runs forever. And continues to grow in width/height
non-stop and i have to end the process to get it to stop updating



--
View this message in context: 
http://apache-flex-users.246.n4.nabble.com/Can-t-get-custom-component-to-size-down-properly-tp13841p13842.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.


Can't get custom component to size down properly

2016-10-18 Thread kamcknig
Hey everyone,

I'm porting a project over to RobotLegs and I had a huge issue of the
components not properly resizing. It has taken me almost two weeks but I've
finally narrowed it down to one (hopefully) component causing all of the
issues.

I have boiled it down to a simple test project.

In my test I have an App class and a MainView class. MainView is a child of
App. I have ResizeEvent.RESIZE listeners on both App and MainView. With just
this, I get trace statements from the resize handlers BOTH when sizing up
and when sizing down.  This is expected. If I add my custom component as a
child of MainView, then I will get the resize handlers traced out when
sizing UP but not when sizing DOWN. So the custom component will grow but
will never shrink. I'm not great when it comes to custom components as I was
a pure AS3 person. 

I have attached the project as a zip file. The problem component is called
BackgroundFill. It's a Group that contains a Rect that gets created and
resized. I noticed that when sizing up both updateDisplayList() and
measure() get called, but when sizing down, neither of them do.

test.zip
  

Thanks for any help!



--
View this message in context: 
http://apache-flex-users.246.n4.nabble.com/Can-t-get-custom-component-to-size-down-properly-tp13841.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.