Loading ...
Sorry, an error occurred while loading the content.
 

Re: Converting user coordinates to root element coordinates

Expand Messages
  • simonshutter
    Thanks, Samy and Helder - I will check out the script Simon
    Message 1 of 7 , Mar 9, 2009
      Thanks, Samy and Helder - I will check out the script

      Simon


      --- In svg-developers@yahoogroups.com, Helder Magalhães <helder.magalhaes@...> wrote:
      >
      > > There is an ecma-script function of Holger Will, with modifications
      > > of Jeff Schiller that does the job.
      >
      > Yes, I believe there is a slightly updated version in a drag sample [1] by Jeff Schiller. (View source and search for "getScreenCTM" if you are curious).
      >
      > Hope this helps,
      > Helder Magalhães
      >
      > [1] http://www.codedread.com/dragtest2.svg
      >
    • ddailey
      ... I gather that you are looking for something like a z-index in HTML. In SVG, this is just the rendering order (within the parent node) [1]. So I suppose if
      Message 2 of 7 , Mar 9, 2009
        Naveen wrote:

        >Ex: If there are 2 elements present in the svg file where one element is present in 1st layer and the other is present in the 2nd layer. Which tag represents the layer data for the elements?

        I gather that you are looking for something like a z-index in HTML. In SVG, this is just the rendering order (within the parent node) [1]. So I suppose if you don't know where something is, you could retrieve its parent, and then loop through the children of the parent keeping track of the index until you find the node in question -- that would be the rough equivalent of its stacking order.

        The question often arises when you wish to change the stacking order (front to back) of objects. This is typically done by removing an object in the middle of the stack and appending it either to the front or bottom of the stack to move it up or down. I think Andreas Neumann has some nice examples at http://www.carto.net/papers/svg/manipulating_svg_with_dom_ecmascript/ , and I found another one by googling http://wiki.svg.org/Rendering_Order (unfortunately it isn't loading right now, but I suppose that is just a temporary thing).

        Hope this helps
        David


        [1] http://www.w3.org/TR/1999/WD-SVG-19990211/render.html

        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.