SVG: attributes relativ to other elements / special anchors ??

Discussion in 'XML' started by Peter Jakobi, Jul 1, 2005.

  1. Peter Jakobi

    Peter Jakobi Guest

    Hello,

    I want to place two lines relative to another. The problem is, that
    these two lines are in different groups.

    Is there an possibility to set the x and y values of the second line
    with the values of the first line + an offset.

    Something like that for example:

    <line id="line1" x1="100" y1="100" x2="200" y2="100"/>
    <line id="line2" x1="100" y1=line1.x1+100 x2="200" y2=line1.x2+100/>

    How can I resvole my problem? Do I have to use javascript, which sets
    up the values for the second line??


    Another question: Can I set some "certain anchors" in svg? I think
    about this problem. There are two lines specified. Each line has an
    "anchor". Now I want to set a line between these two anchors. The
    advantage of that is, that i can mave the two lines without any
    problem. The third line, which connects the two first lines will be
    there everytime.

    Any tips for that problem??


    Thanks,
    Pet
     
    Peter Jakobi, Jul 1, 2005
    #1
    1. Advertisements

  2. Peter Jakobi

    Joris Gillis Guest

    Hi,

    Tempore 15:58:44, die Friday 01 July 2005 AD, hinc in foro {comp.text.xml} scripsit Peter Jakobi <>:

    > Is there an possibility to set the x and y values of the second line
    > with the values of the first line + an offset.
    >
    > <line id="line1" x1="100" y1="100" x2="200" y2="100"/>
    > <line id="line2" x1="100" y1=line1.x1+100 x2="200" y2=line1.x2+100/>


    why not use the 'use' element for this purpose?
    e.g. <use xlink:href="#line1" x="100" y="100"/>

    > Do I have to use javascript, which sets up the values for the second line??

    You could do that. In Javascript you have control over the complete DOM of your svg file.

    > Another question: Can I set some "certain anchors" in svg?

    I do not think anchor points are (yet) defined in svg.


    regards,
    --
    Joris Gillis (http://users.telenet.be/root-jg/me.html)
    Ceterum censeo XML omnibus esse utendum
     
    Joris Gillis, Jul 1, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian K
    Replies:
    0
    Views:
    1,000
    Brian K
    Oct 12, 2003
  2. Gemmel
    Replies:
    0
    Views:
    399
    Gemmel
    Sep 10, 2004
  3. Arne Nordmann
    Replies:
    0
    Views:
    690
    Arne Nordmann
    Jun 28, 2004
  4. Mardagg
    Replies:
    0
    Views:
    1,009
    Mardagg
    May 12, 2006
  5. Mardagg
    Replies:
    0
    Views:
    856
    Mardagg
    May 12, 2006
  6. milof83

    svg to svg saving problem

    milof83, Aug 18, 2006, in forum: Java
    Replies:
    1
    Views:
    1,192
    Roland de Ruiter
    Aug 18, 2006
  7. Ultrus
    Replies:
    4
    Views:
    4,648
    Stefan Behnel
    Aug 30, 2007
  8. grr ruby svg freek

    Ruby-SVG problems with Style attributes

    grr ruby svg freek, Jun 8, 2006, in forum: Ruby
    Replies:
    2
    Views:
    173
    grr ruby svg freek
    Jun 8, 2006
Loading...