flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: [FlexJS] Skinning (was Re: [FlexJS] How to make the drawing APIs work from MXML)
Date Fri, 17 Oct 2014 23:24:21 GMT

On 10/17/14, 1:31 PM, "OmPrakash Muppirala" <bigosmallm@gmail.com> wrote:

>Specifying percentages or LTRB does not the solve the problem of
>maintaining the stroke thickness while scaling.  When buttons scale, we
>want the stroke widths to remain same.  That is where 9-slice helps.  If
>not, you will have to specify a stroke width for every scale.
>Take scroll thumb for an example.  It is a button that one can click and
>move.  At the same time, its height (or width, depending on scrollbar
>direction) should adjust according to the amount of content that is being
>scrolled.  It's skin must have a 9-slice grid defined so that it looks
>at any size.
Maybe I’ve forgotten how computer graphics work, or I am not being clear
enough.  In MXML, if you specify:

<Rect left=“0” right=“0” top=“0” bottom=“0”>
		<SolidColorLine thickness=“2” />

then regardless of the size it is drawn, there will be a two-pixel line
around the rectangle, which is what I think you want (assuming you size it
and don’t scale it).  A scroll thumb would have other logic to center any
“grip” graphics.  

That’s because under the covers, the code will call drawRect(0, 0, width,
height), which I think is what you want.

I would expect SVG to be able to do something similar.


View raw message