You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by kamcknig <ka...@gmail.com> on 2016/09/14 12:51:52 UTC

Can't get Rect to draw one way, but works another

I'm attempting to get a Rect to draw within my code. I have wrapped it in a
group container so as to make it a component I can drop anywhere. I've also
tried creating an MXML class with the root being Rect and I get the same
results.

If I programatically draw the rect in my main class, like so, it works just
fine. i get my rectangle with a gradient that is half the screen width and
height.



However, if i use it as a class, like so, I get just a blank white screen.

Here is my main class:


And here is the BackgroundFill class (note this is a paired down version, I
actually have it set up so they can change more than the color attributes.






--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Can-t-get-Rect-to-draw-one-way-but-works-another-tp13544.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Can't get Rect to draw one way, but works another

Posted by Alex Harui <ah...@adobe.com>.
Without really digging into it, I think Group doesn't have a layout so no
code is around to re-compute sizes of children by evaluation %.  So I
think you will have to write code to resize the Rect.  Doing it in
updateDisplayList would then be the recommended way.

-Alex

On 9/14/16, 7:30 AM, "kamcknig" <ka...@gmail.com> wrote:

>I also then set the width and height of the Rect to equal the
>unscaledWidth/unscaledHeight in the updateDisplayList and that worked
>also.
>
>I'm unsure what the proper way to do things is.
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/Can-t-get-Rect-to-draw-one-
>way-but-works-another-tp13544p13546.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: Can't get Rect to draw one way, but works another

Posted by kamcknig <ka...@gmail.com>.
I also then set the width and height of the Rect to equal the
unscaledWidth/unscaledHeight in the updateDisplayList and that worked also.

I'm unsure what the proper way to do things is.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Can-t-get-Rect-to-draw-one-way-but-works-another-tp13544p13546.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Can't get Rect to draw one way, but works another

Posted by kamcknig <ka...@gmail.com>.
If I set the width and height of the _rect explicitly within the creation
complete of the group such as:



within the BackgroundFill component then it works. But setting percentWidth
and height apparently doesn't auto update the Rect when the size of the
parent changes?



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Can-t-get-Rect-to-draw-one-way-but-works-another-tp13544p13545.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Can't get Rect to draw one way, but works another

Posted by kamcknig <ka...@gmail.com>.
I'll check it out soon!

On Sep 16, 2016 1:09 AM, "OK [via Apache Flex Users]" <
ml-node+s2333346n13551h35@n4.nabble.com> wrote:

> HI,
> I've just accidentally stumbled over this [1]. It contains a styled
> rectangle component.
> Seems that this perfectly fit your needs.
>
> HTH,
> Olaf
>
>
> [1] http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0b
> f687e7-7ff6.html
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-flex-users.2333346.n4.nabble.com/Can-t-
> get-Rect-to-draw-one-way-but-works-another-tp13544p13551.html
> To unsubscribe from Can't get Rect to draw one way, but works another, click
> here
> <http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=13544&code=a2FtY2tuaWdAZ21haWwuY29tfDEzNTQ0fC0xNTg3MjQ1NTM4>
> .
> NAML
> <http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Can-t-get-Rect-to-draw-one-way-but-works-another-tp13544p13552.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Can't get Rect to draw one way, but works another

Posted by OK <po...@olafkrueger.net>.
HI,
I've just accidentally stumbled over this [1]. It contains a styled
rectangle component.
Seems that this perfectly fit your needs.

HTH,
Olaf


[1]
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf687e7-7ff6.html



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Can-t-get-Rect-to-draw-one-way-but-works-another-tp13544p13551.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.