Re: z-index control and relative coordinates: separated at birth?

Rick <[email protected]> Thu, 7 Jan 2010 10:50:13 -0500
Newsgroups gmane.comp.mozilla.devel.svg
Message-ID <[email protected]>
Mawrya.

Relative coordinates are much more flexible than absolute coordinates.

There must be something that you do not understand.

If you have a widget (whatever) draw everything in terms of the widget
and transform it to the location you want by using a transform on the
outer group.

I do this.  You can do this.  You can drag your widgets around the
screen by changing the outer transform.

From your example, it looks like your problem may be that you are
moving from one user coordinate space to another when you re-locate
your widgets.  Don't do that.  Keep it simple, keep them in the
original coordinate space.

My current project involves a geographic situation display that zooms
rotates and pans.  I call that the map layer, and everything that is
part of the map is in that group.  Immediately following that I have
the hud, containing my widgets, the hud is 1:1 and lives on top.

On Wed, Jan 6, 2010 at 10:14 PM, mawrya <[email protected]> wrote:
> I'm working on an app where I have multiple SVG graphics, each
> composed of groups of paths, circles, etc. Each of these groups also
> has a popup graphic that is can be shown/hidden by clicking on the
> group. Something like this:
>
> <g transform="translate(x,y)">
>   <rect .../>
>   <path.../>
>   <g id="popup1" style="display:none;" onclick="toggleDisplayMe
> ("popup1")">
>      <path.../>
>      <path.../>
>   </g>
> </g>
>
>
> The trouble is, the popup can sometimes overlap a nearby graphic
> group. If the markup for this nearby group succeeds that of the popup,
> the painters model demands that the part of the popup that intersects
> this group is covered. This isn't good because popup type objects
> usually should be at the highest layer, the highest z-index.
>
> Of course, the solution is to move the markup for all the popups to
> the end of the svg markup so the painter's model is in harmony with
> the desired affect. Unfortunately, this means I can't use relative
> coordinates for drawing the popups. Relative coordinates were really
> simplifying things and I'm not looking forward to reworking everything
> - I'm not just drawing pictures, but a Human-Machine-Interface
> framework with interactive widget-type graphics that can be created,
> moved around, and have multilple instances of the same widget on the
> screen. Everything can be dynamic and drawn at various coordinates
> based on input from external sources. This is why relative coordinates
> are so handy in my case.
>
> It seems that SVG doesn't let you have it both ways - you can either
> have relative coordinates, or you can have control of layers / z-
> index, not both at once. So, finally, the question: has anyone had
> experience with easily transforming graphics from relative to absolute
> coordinates, when those graphics are embedded in one or more svg
> groups, each of which may have transforms applied to them? I am, of
> course, able to use javascript or XSLT to manipulate the SVG DOM. Or
> the long-shot: there isn't some backdoor hack in mozilla to enable z-
> index in SVG is there? I only need this to work in Firefox.
>
> Thanks for taking the time to read all this.
> _______________________________________________
> dev-tech-svg mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-tech-svg
>



-- 
Cheers!
Rick