W3C home > Mailing lists > Public > www-svg@w3.org > November 2013

Re: Automatic centering and positioning

From: Paul LeBeau <paul.lebeau@gmail.com>
Date: Sat, 9 Nov 2013 13:09:49 +1300
Message-ID: <CACfsppC-5G6LwbZjq=p-4fPL+sDLPw4DtkiomCADnSH3k6yaVg@mail.gmail.com>
To: Alex Bell <alex@bellandwhistle.net>
Cc: www-svg <www-svg@w3.org>
> I'm all for authoring convenience, but mutual centering is achievable in
Illustrator (for example)

That's true, but there are a *lot* of people using SVG now that aren't
working with preconstructed documents.  A majority of the SVG questions on
Stack Overflow are related to SVG generating libraries such as D3.js
or RaphaŽl.
 They are creating graphs or infographics at runtime.

I am open to the idea that CSS can be a solution to this, but curious what
sort of layout mode Tab et al are thinking about.

What I guess I was thinking was something like a new property
"relative-position" that takes a <funciri> and an <dx> and <dy> and applies
a translate transform based on the two objects' bounding boxes.  It would
need to allow for positioning relative to right and bottom edges - not just
left and top. And also would need a mechanism to deal with circular
dependencies etc.

Paul






On 9 November 2013 12:22, Alex Bell <alex@bellandwhistle.net> wrote:

> Paul LeBeau wrote:
>
> I have spent a bit of time on Stack Overflow lately, answering questions on
> SVG.  It seems a very common use case that people want to centre elements
> inside other elements.  For example, text in a circle, image in a box.
>
> I have been wondering if this use case has been discussed before and
> whether there were any previous proposals or interest in adding some sort
> of feature that can automatically position elements with respect to a box
> or other element.
>
> ***********
>
> I'm all for authoring convenience, but mutual centering is achievable in
> Illustrator (for example) with one click on the "Align" tab. Also, how
> would the new feature take account of matrix transformations on the element
> being aligned to? Or would it just refer to the bounding box? Would the
> positioning reference be chainable, i.e. an element centered with respect
> to an element centered with respect to another element?
>
> Paul, was element nesting one of your ideas for this? Can you explain more?
>
> -Alex
>
>
Received on Saturday, 9 November 2013 00:10:37 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:47 UTC