On 10/17/14, 4:42 PM, "OmPrakash Muppirala" <bigosma...@gmail.com> wrote:

>>
>> (assuming you size it and don’t scale it).
>>
>
>I think this is the key.  Scaling is so much more easier to do than resize
>each and every element.
Maybe I don’t understand what that means.  One of the main benefits of
vector graphics is that the graphics can be redrawn at different sizes
with fewer artifacts than scaling raster graphics.  IMO, Scale-9 is
primarily intended to handle raster graphics (bitmaps).  To me, it would
be a flaw in the system if you couldn’t take advantage of vectors to
handle different sizings.

Flex default skins generally use LTRB to essentially redraw the vectors at
different sizes.  LTRB and % makes the skins more “flex”-ible.

>
>Both on the Flash and the SVG side, the power and flexibility comes from
>the fact that they are inherently scalable.  Your resizing approach would
>entail attaching resize handlers to their containers and redrawing the
>graphic element by element.  Is that what you are proposing?

I don’t have enough data to propose anything other than, in principle, if
you have vectors you should be able to redraw them instead of just plain
scaling them.  A linear gradient fill for a rounded rectangle won’t be
linear after you scale it with scale-9, but maybe most folks don’t care.

I’m wondering how folks use SVG in the HTML/JS/CSS/SVG world with respect
to this resizing issue.  SVG seems to support %.  I guess all the SVG tags
goes in some SVG container.  What happens if you give that SVG container a
new width/height?  Do the vectors get redrawn or scaled?.  If scaled, are
people trying to approximate scale-9 or crying about the fact there is no
good vector resizing option?

It never occurred to me until this thread that FXG, if it in fact doesn’t
support % or LTRB, which it probably doesn’t because I don’t think
DefineShape supports it, was flawed in this way.  It made you treat
vectors like bitmaps when resizing, effectively taking away the advantages
of vectors.

I also don’t know what the authoring tools like Illustrator support, and
whether the designers who use them know how, or are willing to learn how
to do vector resizing.  If folks who create SVG for HTML/JS/CSS/SVG are
using an authoring tool, can they specify % values in the SVG?

It always felt in current Flex that we had “code” skins that were written
by developers and handled vector resizing and allowed designers to create
"code-less" skins that didn’t handle vector resizing.  Maybe we still need
that distinction in FlexJS, but if SVG does support vector resizing and
designers know how to leverage that, we should try to take advantage of
that.  It could remove or severely reduce the need to replicate scale-9 on
the JS side.

Technically, resizing doesn’t truly require resize handlers.  Both Flex
and FlexJS are trying to implement top-down sizing.  The “stage” has a
particular size, and containers often specify their sizes via
“constraints” such as % values or LTRB (and also
horizontalCenter/verticalCenter) instead of numbers.  Some layout looks at
the size and constraints and sets the size of the children.  If those
children specify vectors with relative sizes using % or LTRB or
hCenter/vCenter or data binding, then the binding updates the properties
in the vectors and a simple redrawing of the vectors should apply the
constraints against new values and produce the right result.  The author
of the skins should not need to hook up to resize events; the tags in the
markup, binding expressions and the framework should take care of
everything.

If SVG supports both % and LTRB (I heard it does via CSS?) then we might
want to start with SVG and emulate it in the AS-side of FlexJS.  That’s a
general FlexJS philosophy anyway.  IMO there is no requirement to support
FXG in FlexJS if it is less powerful than SVG.

And of course, I could be wrong, so I definitely want to hear what others
have to say.

-Alex

Reply via email to