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

changing value

Expand Messages
  • antoine j. quint, esq.
    hello, I m having a bit of a problem trying to change the text data inside of a element through the DOM. I m trying to do this
    Message 1 of 13 , Nov 6, 2000
    • 0 Attachment
      hello,

      I'm having a bit of a problem trying to change the text data inside of a
      <tspan> element through the DOM. I'm trying to do this

      document.svg.getSVGDocument().getElementById('menu1span').deleteData();

      and then I would like to use insertData();

      with that SVG code

      <text id="menu1" transform="matrix(1 0 0 1 9 100.0664)"><tspan x="0" y="0"
      id="menu1span" style="stroke:none;">the text to change</tspan></text>

      I get the error from IE that I can't use this method on that object which is
      pretty strange since the Adobe viewer implements both methods. Anybody knows
      how to do this?

      antoine
      ____________________________________________________________________________

      Antoine Quint <antoine@...>
      XML developer / SVG designer
      +33 6 03 11 21 23 mobile

      k n o w s c a p e : // www.knowscape.com

      Knowscape LLC - 151 1st Avenue, Suite 68 - New York, NY 10003 - USA
      +1 212 504 8168 tel
      +1 212 202 7700 fax

      Knowscape SARL - 9ter, rue Auguste Barbier - 75011 Paris - France
      +33 1 42 01 00 07 tel
      +33 1 43 57 23 47 fax
      ____________________________________________________________________________
    • Jasen Jacobsen
      ... of a ... You can check the JavaScript #2 at the demo/tutorial I set up at http://www.xfront.org/svgdemo. I do this in there. Essentially, you don t change
      Message 2 of 13 , Nov 6, 2000
      • 0 Attachment
        --- In svg-developers@egroups.com, "antoine j. quint, esq."
        <antoine@g...> wrote:
        > hello,
        >
        > I'm having a bit of a problem trying to change the text data inside
        of a
        > <tspan> element through the DOM.

        You can check the JavaScript #2 at the demo/tutorial I set up at
        http://www.xfront.org/svgdemo. I do this in there.

        Essentially, you don't change the tspan, you change the text node
        that is a child of the tspan, like this:

        tspanChildren = textChild.getElementsByTagName
        ("tspan");

        if (tspanChildren == null)
        {
        // Couldn't find any <tspan>s, so can't
        continue.
        return null;
        }

        if (tspanChildren.item((x*3)+2).firstChild != null)
        {
        tspanChildren.item((x*3)
        +2).firstChild.nodeValue = currValue;
        } else {
        // We need to add a text node to the <tspan>

        newNode = svgdoc.createTextNode(currValue);
        tspanChildren.item((x*3)+2).appendChild
        (newNode);
        }

        In the above, firstChild is the text node where the data actually is.

        For deleting, you could delete the whole tspan, or it may be enough
        to delete the text node that is its child.

        - Jasen.
      • Harrell, Wade
        Deleting the data child of the tspan seems to be a bit of overkill. Why not just set it == ? So: svgdoc.getElementById(textZone).getFirstChild().data =
        Message 3 of 13 , Nov 6, 2000
        • 0 Attachment
          Deleting the data child of the tspan seems to be a bit of overkill. Why not
          just set it == '' ? So:

          svgdoc.getElementById(textZone).getFirstChild().data = '';


          Wade Harrell * Wade.Harrell@...
          Sr Content Engineer * Iguana Studios Inc
          vox:212.209.1380 * fax:212.243.6506
          16 W 19th * 10th Floor
          New York, NY 10011 - 4205
          http://www.iguanastudios.com
          Latitude: 40.739145 (40° 44' 20" N)
          Longitude: -73.992089 (73° 59' 31" W)

          -----Original Message-----
          From: Jasen Jacobsen [mailto:jasenj1@...]
          Sent: Monday, November 06, 2000 11:01 AM
          To: svg-developers@egroups.com
          Subject: [svg-developers] Re: changing <tspan> value


          --- In svg-developers@egroups.com, "antoine j. quint, esq."
          <antoine@g...> wrote:
          > hello,
          >
          > I'm having a bit of a problem trying to change the text data inside
          of a
          > <tspan> element through the DOM.

          You can check the JavaScript #2 at the demo/tutorial I set up at
          http://www.xfront.org/svgdemo. I do this in there.

          Essentially, you don't change the tspan, you change the text node
          that is a child of the tspan, like this:

          tspanChildren = textChild.getElementsByTagName
          ("tspan");

          if (tspanChildren == null)
          {
          // Couldn't find any <tspan>s, so can't
          continue.
          return null;
          }

          if (tspanChildren.item((x*3)+2).firstChild != null)
          {
          tspanChildren.item((x*3)
          +2).firstChild.nodeValue = currValue;
          } else {
          // We need to add a text node to the <tspan>

          newNode = svgdoc.createTextNode(currValue);
          tspanChildren.item((x*3)+2).appendChild
          (newNode);
          }

          In the above, firstChild is the text node where the data actually is.

          For deleting, you could delete the whole tspan, or it may be enough
          to delete the text node that is its child.

          - Jasen.
        • Steve White
          I notice that when you transform (stretch) an element, it stretches the outline. ex: http://www.virtualmechanics.com/test/stretch.svg I don t suppose there is
          Message 4 of 13 , Nov 6, 2000
          • 0 Attachment
            I notice that when you transform (stretch) an element, it stretches the
            outline. ex: http://www.virtualmechanics.com/test/stretch.svg I don't
            suppose there is any simple way to prevent this?

            Yours Truly

            Steve White
            steve@...
            www.VirtualMechanics.com
          • Harrell, Wade
            This is a good question. In a few experiments I have been doing with the file you linked I have been unable to apply a stroke to a scaled object without that
            Message 5 of 13 , Nov 6, 2000
            • 0 Attachment
              This is a good question. In a few experiments I have been doing with the
              file you linked I have been unable to apply a stroke to a scaled object
              without that stroke being scaled as well. This poses a problem for
              instances where increasing the stroke-width on scale is undesirable.

              Does anyone else on the list have any insight into a solution for locking
              the stroke-width regardless of the scale?

              Wade Harrell * Wade.Harrell@...
              Sr Content Engineer * Iguana Studios Inc
              vox:212.209.1380 * fax:212.243.6506
              16 W 19th * 10th Floor
              New York, NY 10011 - 4205
              http://www.iguanastudios.com
              Latitude: 40.739145 (40° 44' 20" N)
              Longitude: -73.992089 (73° 59' 31" W)

              -----Original Message-----
              From: Steve White [mailto:steve@...]
              Sent: Monday, November 06, 2000 12:21 PM
              To: svg-developers@egroups.com
              Subject: [svg-developers] stretched outline


              I notice that when you transform (stretch) an element, it stretches the
              outline. ex: http://www.virtualmechanics.com/test/stretch.svg I don't
              suppose there is any simple way to prevent this?

              Yours Truly

              Steve White
              steve@...
              www.VirtualMechanics.com
            • goessner@mecxpert.de
              some time ago i asked a similar question .. resolved by chris .. http://www.egroups.com/message/svg-developers/329 hope that helps .. s.goessner ... with the
              Message 6 of 13 , Nov 6, 2000
              • 0 Attachment
                some time ago i asked a similar question .. resolved by chris ..

                http://www.egroups.com/message/svg-developers/329

                hope that helps ..

                s.goessner

                --- In svg-developers@egroups.com, "Harrell, Wade" <wade@i...> wrote:
                > This is a good question. In a few experiments I have been doing
                with the
                > file you linked I have been unable to apply a stroke to a scaled
                object
                > without that stroke being scaled as well. This poses a problem for
                > instances where increasing the stroke-width on scale is undesirable.
                >
                > Does anyone else on the list have any insight into a solution for
                locking
                > the stroke-width regardless of the scale?
                >
                > Wade Harrell * Wade.Harrell@i...
                > Sr Content Engineer * Iguana Studios Inc
                > vox:212.209.1380 * fax:212.243.6506
                > 16 W 19th * 10th Floor
                > New York, NY 10011 - 4205
                > http://www.iguanastudios.com
                > Latitude: 40.739145 (40° 44' 20" N)
                > Longitude: -73.992089 (73° 59' 31" W)
                >
                > -----Original Message-----
                > From: Steve White [mailto:steve@V...]
                > Sent: Monday, November 06, 2000 12:21 PM
                > To: svg-developers@egroups.com
                > Subject: [svg-developers] stretched outline
                >
                >
                > I notice that when you transform (stretch) an element, it stretches
                the
                > outline. ex: http://www.virtualmechanics.com/test/stretch.svg I
                don't
                > suppose there is any simple way to prevent this?
                >
                > Yours Truly
                >
                > Steve White
                > steve@V...
                > www.VirtualMechanics.com
              • Harrell, Wade
                hmmmm, maybe I am seeing an issue with the Adobe viewer then. I tried all three examples from that post and all three gave the same result. A rectangle with
                Message 7 of 13 , Nov 6, 2000
                • 0 Attachment
                  hmmmm, maybe I am seeing an issue with the Adobe viewer then. I tried all
                  three examples from that post and all three gave the same result. A
                  rectangle with 1px left & right but approx 10px top and bottom.

                  Wade Harrell * Wade.Harrell@...
                  Sr Content Engineer * Iguana Studios Inc
                  vox:212.209.1380 * fax:212.243.6506
                  16 W 19th * 10th Floor
                  New York, NY 10011 - 4205
                  http://www.iguanastudios.com
                  Latitude: 40.739145 (40° 44' 20" N)
                  Longitude: -73.992089 (73° 59' 31" W)

                  -----Original Message-----
                  From: goessner@... [mailto:goessner@...]
                  Sent: Monday, November 06, 2000 4:34 PM
                  To: svg-developers@egroups.com
                  Subject: [svg-developers] Re: stretched outline


                  some time ago i asked a similar question .. resolved by chris ..

                  http://www.egroups.com/message/svg-developers/329

                  hope that helps ..

                  s.goessner

                  --- In svg-developers@egroups.com, "Harrell, Wade" <wade@i...> wrote:
                  > This is a good question. In a few experiments I have been doing
                  with the
                  > file you linked I have been unable to apply a stroke to a scaled
                  object
                  > without that stroke being scaled as well. This poses a problem for
                  > instances where increasing the stroke-width on scale is undesirable.
                  >
                  > Does anyone else on the list have any insight into a solution for
                  locking
                  > the stroke-width regardless of the scale?
                  >
                  > Wade Harrell * Wade.Harrell@i...
                  > Sr Content Engineer * Iguana Studios Inc
                  > vox:212.209.1380 * fax:212.243.6506
                  > 16 W 19th * 10th Floor
                  > New York, NY 10011 - 4205
                  > http://www.iguanastudios.com
                  > Latitude: 40.739145 (40° 44' 20" N)
                  > Longitude: -73.992089 (73° 59' 31" W)
                  >
                  > -----Original Message-----
                  > From: Steve White [mailto:steve@V...]
                  > Sent: Monday, November 06, 2000 12:21 PM
                  > To: svg-developers@egroups.com
                  > Subject: [svg-developers] stretched outline
                  >
                  >
                  > I notice that when you transform (stretch) an element, it stretches
                  the
                  > outline. ex: http://www.virtualmechanics.com/test/stretch.svg I
                  don't
                  > suppose there is any simple way to prevent this?
                  >
                  > Yours Truly
                  >
                  > Steve White
                  > steve@V...
                  > www.VirtualMechanics.com
                • goessner@mecxpert.de
                  wade, .. i remember .. i also considered something wrong with adobe viewer s result. maybe someone of adobes developers crew can comment this .. s.goessner ...
                  Message 8 of 13 , Nov 6, 2000
                  • 0 Attachment
                    wade,
                    .. i remember .. i also considered something wrong with adobe
                    viewer's result. maybe someone of adobes developers crew can comment
                    this ..

                    s.goessner

                    --- In svg-developers@egroups.com, "Harrell, Wade" <wade@i...> wrote:
                    > hmmmm, maybe I am seeing an issue with the Adobe viewer then. I
                    tried all
                    > three examples from that post and all three gave the same result. A
                    > rectangle with 1px left & right but approx 10px top and bottom.
                    >
                    > Wade Harrell * Wade.Harrell@i...
                    > Sr Content Engineer * Iguana Studios Inc
                    > vox:212.209.1380 * fax:212.243.6506
                    > 16 W 19th * 10th Floor
                    > New York, NY 10011 - 4205
                    > http://www.iguanastudios.com
                    > Latitude: 40.739145 (40° 44' 20" N)
                    > Longitude: -73.992089 (73° 59' 31" W)
                    >
                    > -----Original Message-----
                    > From: goessner@m... [mailto:goessner@m...]
                    > Sent: Monday, November 06, 2000 4:34 PM
                    > To: svg-developers@egroups.com
                    > Subject: [svg-developers] Re: stretched outline
                    >
                    >
                    > some time ago i asked a similar question .. resolved by chris ..
                    >
                    > http://www.egroups.com/message/svg-developers/329
                    >
                    > hope that helps ..
                    >
                    > s.goessner
                    >
                    > --- In svg-developers@egroups.com, "Harrell, Wade" <wade@i...>
                    wrote:
                    > > This is a good question. In a few experiments I have been doing
                    > with the
                    > > file you linked I have been unable to apply a stroke to a scaled
                    > object
                    > > without that stroke being scaled as well. This poses a problem
                    for
                    > > instances where increasing the stroke-width on scale is
                    undesirable.
                    > >
                    > > Does anyone else on the list have any insight into a solution for
                    > locking
                    > > the stroke-width regardless of the scale?
                    > >
                    > > Wade Harrell * Wade.Harrell@i...
                    > > Sr Content Engineer * Iguana Studios Inc
                    > > vox:212.209.1380 * fax:212.243.6506
                    > > 16 W 19th * 10th Floor
                    > > New York, NY 10011 - 4205
                    > > http://www.iguanastudios.com
                    > > Latitude: 40.739145 (40° 44' 20" N)
                    > > Longitude: -73.992089 (73° 59' 31" W)
                    > >
                    > > -----Original Message-----
                    > > From: Steve White [mailto:steve@V...]
                    > > Sent: Monday, November 06, 2000 12:21 PM
                    > > To: svg-developers@egroups.com
                    > > Subject: [svg-developers] stretched outline
                    > >
                    > >
                    > > I notice that when you transform (stretch) an element, it
                    stretches
                    > the
                    > > outline. ex: http://www.virtualmechanics.com/test/stretch.svg I
                    > don't
                    > > suppose there is any simple way to prevent this?
                    > >
                    > > Yours Truly
                    > >
                    > > Steve White
                    > > steve@V...
                    > > www.VirtualMechanics.com
                  • Jasen Jacobsen
                    ... overkill. Why not ... Because if you hand-code or programmically generate the svg you end up with tspans that look like . There is no child node.
                    Message 9 of 13 , Nov 7, 2000
                    • 0 Attachment
                      --- In svg-developers@egroups.com, "Harrell, Wade" <wade@i...> wrote:
                      > Deleting the data child of the tspan seems to be a bit of
                      overkill. Why not
                      > just set it == '' ? So:
                      >
                      > svgdoc.getElementById(textZone).getFirstChild().data = '';

                      Because if you hand-code or programmically generate the svg you end
                      up with tspans that look like <tspan/>. There is no child node.

                      - Jasen.
                    • Jon Ferraiolo
                      There has been an email thread which I haven t had time to respond to until now about maintaining constant stroke width when enclosed by a non-uniform
                      Message 10 of 13 , Nov 7, 2000
                      • 0 Attachment
                        There has been an email thread which I haven't had time to respond to until
                        now about maintaining constant stroke width when enclosed by a non-uniform
                        transformation. For example:

                        <svg>
                        <g transform="scale(2 1)">
                        <circle cx="30" cy="30" r="20" style="fill:none; stroke:black;
                        stroke-width:3"/>
                        </g>
                        </svg>

                        People have observed that the stroke is non-uniform in the above case with
                        the Adobe viewer. That is correct behavior. When Chris responded a long
                        time ago on this subject, he responded incorrectly. Chris and I exchanged
                        email on this at the time. I thought a correction was posted, but maybe it
                        wasn't.

                        Think of things as follows. The rendering of any given object (for example,
                        the circle above) is performed as if the object had no knowledge about any
                        enclosing transformations into its own local coordinate system, which looks
                        to the object as if it were a Cartesian coordinate system with "square"
                        units. (That is, one unit in X looks to be the same size as one unit in Y.)
                        Thus, in the local coordinate system, the circle looks circular, and the
                        strokes is the same width throughout.

                        However, because there is a non-uniform scale transformation around the
                        circle, the circle and its stroke get stretched. Thus, the circle turns
                        into an ellipse, and the stroke of the circle also gets stretched similarly
                        and appears with non-uniform thickness.

                        Conceptually, stroke is really just a shorthand for another fill. A stroke
                        is done by converting the outline of the stroke into a new graphic object
                        and then filling that outline just as if it were a graphic object. Thus,
                        transformations apply to strokes just as they apply to graphics.

                        In the above example, to stretch the circle into an ellipse but have a
                        constant stroke width on that ellipse, you have to change the coordinates
                        of the circle/ellipse instead of enclosing the object with a
                        transformation. For example:

                        <ellipse cx="60" cy="30" rx="40" ry="20" style="fill:none;
                        stroke:black; stroke-width:3"/>

                        There has also been discussion about CSS units perhaps "helping'". They
                        don't. CSS units have no effect on this issue. The rule in the SVG spec has
                        always been that CSS units get converted into equivalent user units using
                        some magic formulas, and then all rendering is done as if the equivalent
                        user units had been specified.

                        Jon Ferraiolo
                        SVG Editor
                        Adobe Systems Incorporated


                        At 07:22 AM 11/7/00 +0000, goessner@... wrote:
                        >wade,
                        >.. i remember .. i also considered something wrong with adobe
                        >viewer's result. maybe someone of adobes developers crew can comment
                        >this ..
                        >
                        >s.goessner
                        >
                        >--- In svg-developers@egroups.com, "Harrell, Wade" <wade@i...> wrote:
                        > > hmmmm, maybe I am seeing an issue with the Adobe viewer then. I
                        >tried all
                        > > three examples from that post and all three gave the same result. A
                        > > rectangle with 1px left & right but approx 10px top and bottom.
                        > >
                        > > Wade Harrell * Wade.Harrell@i...
                        > > Sr Content Engineer * Iguana Studios Inc
                        > > vox:212.209.1380 * fax:212.243.6506
                        > > 16 W 19th * 10th Floor
                        > > New York, NY 10011 - 4205
                        > > http://www.iguanastudios.com
                        > > Latitude: 40.739145 (40° 44' 20" N)
                        > > Longitude: -73.992089 (73° 59' 31" W)
                        > >
                        > > -----Original Message-----
                        > > From: goessner@m... [mailto:goessner@m...]
                        > > Sent: Monday, November 06, 2000 4:34 PM
                        > > To: svg-developers@egroups.com
                        > > Subject: [svg-developers] Re: stretched outline
                        > >
                        > >
                        > > some time ago i asked a similar question .. resolved by chris ..
                        > >
                        > > http://www.egroups.com/message/svg-developers/329
                        > >
                        > > hope that helps ..
                        > >
                        > > s.goessner
                        > >
                        > > --- In svg-developers@egroups.com, "Harrell, Wade" <wade@i...>
                        >wrote:
                        > > > This is a good question. In a few experiments I have been doing
                        > > with the
                        > > > file you linked I have been unable to apply a stroke to a scaled
                        > > object
                        > > > without that stroke being scaled as well. This poses a problem
                        >for
                        > > > instances where increasing the stroke-width on scale is
                        >undesirable.
                        > > >
                        > > > Does anyone else on the list have any insight into a solution for
                        > > locking
                        > > > the stroke-width regardless of the scale?
                        > > >
                        > > > Wade Harrell * Wade.Harrell@i...
                        > > > Sr Content Engineer * Iguana Studios Inc
                        > > > vox:212.209.1380 * fax:212.243.6506
                        > > > 16 W 19th * 10th Floor
                        > > > New York, NY 10011 - 4205
                        > > > http://www.iguanastudios.com
                        > > > Latitude: 40.739145 (40° 44' 20" N)
                        > > > Longitude: -73.992089 (73° 59' 31" W)
                        > > >
                        > > > -----Original Message-----
                        > > > From: Steve White [mailto:steve@V...]
                        > > > Sent: Monday, November 06, 2000 12:21 PM
                        > > > To: svg-developers@egroups.com
                        > > > Subject: [svg-developers] stretched outline
                        > > >
                        > > >
                        > > > I notice that when you transform (stretch) an element, it
                        >stretches
                        > > the
                        > > > outline. ex: http://www.virtualmechanics.com/test/stretch.svg I
                        > > don't
                        > > > suppose there is any simple way to prevent this?
                        > > >
                        > > > Yours Truly
                        > > >
                        > > > Steve White
                        > > > steve@V...
                        > > > www.VirtualMechanics.com
                        >
                        >
                        >
                      • Harrell, Wade
                        ok. For a Circle the solution is as you have shown. How would you recommend keeping a constant stroke on a path that is enclosed by a non-uniform
                        Message 11 of 13 , Nov 7, 2000
                        • 0 Attachment
                          ok. For a Circle the solution is as you have shown. How would you
                          recommend keeping a constant stroke on a path that is enclosed by a
                          non-uniform transformation? This is the problem. Trying to allow users to
                          resize elements without changing the stroke width. So they can have a path
                          that is three times as wide and twice as tall as the original but still
                          maintaining the original stroke width.

                          For a uniform scale I suspect I could build a script that will adjust the
                          stroke-width appropriately.

                          Wade Harrell * Wade.Harrell@...
                          Sr Content Engineer * Iguana Studios Inc
                          vox:212.209.1380 * fax:212.243.6506
                          16 W 19th * 10th Floor
                          New York, NY 10011 - 4205
                          http://www.iguanastudios.com
                          Latitude: 40.739145 (40° 44' 20" N)
                          Longitude: -73.992089 (73° 59' 31" W)

                          -----Original Message-----
                          From: Jon Ferraiolo [mailto:jferraio@...]
                          Sent: Tuesday, November 07, 2000 12:21 PM
                          To: svg-developers@egroups.com
                          Subject: Re: [svg-developers] Re: stretched outline


                          There has been an email thread which I haven't had time to respond to until
                          now about maintaining constant stroke width when enclosed by a non-uniform
                          transformation. For example:

                          <svg>
                          <g transform="scale(2 1)">
                          <circle cx="30" cy="30" r="20" style="fill:none; stroke:black;
                          stroke-width:3"/>
                          </g>
                          </svg>

                          People have observed that the stroke is non-uniform in the above case with
                          the Adobe viewer. That is correct behavior. When Chris responded a long
                          time ago on this subject, he responded incorrectly. Chris and I exchanged
                          email on this at the time. I thought a correction was posted, but maybe it
                          wasn't.

                          Think of things as follows. The rendering of any given object (for example,
                          the circle above) is performed as if the object had no knowledge about any
                          enclosing transformations into its own local coordinate system, which looks
                          to the object as if it were a Cartesian coordinate system with "square"
                          units. (That is, one unit in X looks to be the same size as one unit in Y.)
                          Thus, in the local coordinate system, the circle looks circular, and the
                          strokes is the same width throughout.

                          However, because there is a non-uniform scale transformation around the
                          circle, the circle and its stroke get stretched. Thus, the circle turns
                          into an ellipse, and the stroke of the circle also gets stretched similarly
                          and appears with non-uniform thickness.

                          Conceptually, stroke is really just a shorthand for another fill. A stroke
                          is done by converting the outline of the stroke into a new graphic object
                          and then filling that outline just as if it were a graphic object. Thus,
                          transformations apply to strokes just as they apply to graphics.

                          In the above example, to stretch the circle into an ellipse but have a
                          constant stroke width on that ellipse, you have to change the coordinates
                          of the circle/ellipse instead of enclosing the object with a
                          transformation. For example:

                          <ellipse cx="60" cy="30" rx="40" ry="20" style="fill:none;
                          stroke:black; stroke-width:3"/>

                          There has also been discussion about CSS units perhaps "helping'". They
                          don't. CSS units have no effect on this issue. The rule in the SVG spec has
                          always been that CSS units get converted into equivalent user units using
                          some magic formulas, and then all rendering is done as if the equivalent
                          user units had been specified.

                          Jon Ferraiolo
                          SVG Editor
                          Adobe Systems Incorporated


                          At 07:22 AM 11/7/00 +0000, goessner@... wrote:
                          >wade,
                          >.. i remember .. i also considered something wrong with adobe
                          >viewer's result. maybe someone of adobes developers crew can comment
                          >this ..
                          >
                          >s.goessner
                          >
                          >--- In svg-developers@egroups.com, "Harrell, Wade" <wade@i...> wrote:
                          > > hmmmm, maybe I am seeing an issue with the Adobe viewer then. I
                          >tried all
                          > > three examples from that post and all three gave the same result. A
                          > > rectangle with 1px left & right but approx 10px top and bottom.
                          > >
                          > > Wade Harrell * Wade.Harrell@i...
                          > > Sr Content Engineer * Iguana Studios Inc
                          > > vox:212.209.1380 * fax:212.243.6506
                          > > 16 W 19th * 10th Floor
                          > > New York, NY 10011 - 4205
                          > > http://www.iguanastudios.com
                          > > Latitude: 40.739145 (40° 44' 20" N)
                          > > Longitude: -73.992089 (73° 59' 31" W)
                          > >
                          > > -----Original Message-----
                          > > From: goessner@m... [mailto:goessner@m...]
                          > > Sent: Monday, November 06, 2000 4:34 PM
                          > > To: svg-developers@egroups.com
                          > > Subject: [svg-developers] Re: stretched outline
                          > >
                          > >
                          > > some time ago i asked a similar question .. resolved by chris ..
                          > >
                          > > http://www.egroups.com/message/svg-developers/329
                          > >
                          > > hope that helps ..
                          > >
                          > > s.goessner
                          > >
                          > > --- In svg-developers@egroups.com, "Harrell, Wade" <wade@i...>
                          >wrote:
                          > > > This is a good question. In a few experiments I have been doing
                          > > with the
                          > > > file you linked I have been unable to apply a stroke to a scaled
                          > > object
                          > > > without that stroke being scaled as well. This poses a problem
                          >for
                          > > > instances where increasing the stroke-width on scale is
                          >undesirable.
                          > > >
                          > > > Does anyone else on the list have any insight into a solution for
                          > > locking
                          > > > the stroke-width regardless of the scale?
                          > > >
                          > > > Wade Harrell * Wade.Harrell@i...
                          > > > Sr Content Engineer * Iguana Studios Inc
                          > > > vox:212.209.1380 * fax:212.243.6506
                          > > > 16 W 19th * 10th Floor
                          > > > New York, NY 10011 - 4205
                          > > > http://www.iguanastudios.com
                          > > > Latitude: 40.739145 (40° 44' 20" N)
                          > > > Longitude: -73.992089 (73° 59' 31" W)
                          > > >
                          > > > -----Original Message-----
                          > > > From: Steve White [mailto:steve@V...]
                          > > > Sent: Monday, November 06, 2000 12:21 PM
                          > > > To: svg-developers@egroups.com
                          > > > Subject: [svg-developers] stretched outline
                          > > >
                          > > >
                          > > > I notice that when you transform (stretch) an element, it
                          >stretches
                          > > the
                          > > > outline. ex: http://www.virtualmechanics.com/test/stretch.svg I
                          > > don't
                          > > > suppose there is any simple way to prevent this?
                          > > >
                          > > > Yours Truly
                          > > >
                          > > > Steve White
                          > > > steve@V...
                          > > > www.VirtualMechanics.com
                          >
                          >
                          >
                        • Steve White
                          I think the issue here is whether a transform is a valid way to create geometry. I have certainly used it that way for a long time. It becomes more relevant
                          Message 12 of 13 , Nov 7, 2000
                          • 0 Attachment
                            I think the issue here is whether a transform is a valid way to create
                            geometry. I have certainly used it that way for a long time. It becomes more
                            relevant when working in 3D or Solid Modeling; performing extrusions,
                            Boolean editing etc. If you cannot maintain a consistent outline it would be
                            impossible to use these operations for complex modal building. Wire
                            Frame/Hidden Surface projections for example, would be unworkable. 2D is
                            really no different. We use 2D stretch, rotate and move extrusions to build
                            complex geometry. Variable stroke widths will produce undesirable effects.

                            I for one think that a mechanism is needed to set an absolute stroke width.
                            I thought the method posted at:
                            http://www.egroups.com/message/svg-developers/329 was quite an elegant
                            solution.

                            Yours Truly

                            Steve
                            steve@...
                            www.VirtualMechanics.com

                            -----Original Message-----
                            From: Harrell, Wade [mailto:wade@...]
                            Sent: Tuesday, November 07, 2000 12:26 PM
                            To: 'svg-developers@egroups.com'
                            Subject: RE: [svg-developers] Re: stretched outline


                            ok. For a Circle the solution is as you have shown. How would you
                            recommend keeping a constant stroke on a path that is enclosed by a
                            non-uniform transformation? This is the problem. Trying to allow users to
                            resize elements without changing the stroke width. So they can have a path
                            that is three times as wide and twice as tall as the original but still
                            maintaining the original stroke width.

                            For a uniform scale I suspect I could build a script that will adjust the
                            stroke-width appropriately.

                            Wade Harrell * Wade.Harrell@...
                            Sr Content Engineer * Iguana Studios Inc
                            vox:212.209.1380 * fax:212.243.6506
                            16 W 19th * 10th Floor
                            New York, NY 10011 - 4205
                            http://www.iguanastudios.com
                            Latitude: 40.739145 (40° 44' 20" N)
                            Longitude: -73.992089 (73° 59' 31" W)

                            -----Original Message-----
                            From: Jon Ferraiolo [mailto:jferraio@...]
                            Sent: Tuesday, November 07, 2000 12:21 PM
                            To: svg-developers@egroups.com
                            Subject: Re: [svg-developers] Re: stretched outline


                            There has been an email thread which I haven't had time to respond to until
                            now about maintaining constant stroke width when enclosed by a non-uniform
                            transformation. For example:

                            <svg>
                            <g transform="scale(2 1)">
                            <circle cx="30" cy="30" r="20" style="fill:none; stroke:black;
                            stroke-width:3"/>
                            </g>
                            </svg>

                            People have observed that the stroke is non-uniform in the above case with
                            the Adobe viewer. That is correct behavior. When Chris responded a long
                            time ago on this subject, he responded incorrectly. Chris and I exchanged
                            email on this at the time. I thought a correction was posted, but maybe it
                            wasn't.

                            Think of things as follows. The rendering of any given object (for example,
                            the circle above) is performed as if the object had no knowledge about any
                            enclosing transformations into its own local coordinate system, which looks
                            to the object as if it were a Cartesian coordinate system with "square"
                            units. (That is, one unit in X looks to be the same size as one unit in Y.)
                            Thus, in the local coordinate system, the circle looks circular, and the
                            strokes is the same width throughout.

                            However, because there is a non-uniform scale transformation around the
                            circle, the circle and its stroke get stretched. Thus, the circle turns
                            into an ellipse, and the stroke of the circle also gets stretched similarly
                            and appears with non-uniform thickness.

                            Conceptually, stroke is really just a shorthand for another fill. A stroke
                            is done by converting the outline of the stroke into a new graphic object
                            and then filling that outline just as if it were a graphic object. Thus,
                            transformations apply to strokes just as they apply to graphics.

                            In the above example, to stretch the circle into an ellipse but have a
                            constant stroke width on that ellipse, you have to change the coordinates
                            of the circle/ellipse instead of enclosing the object with a
                            transformation. For example:

                            <ellipse cx="60" cy="30" rx="40" ry="20" style="fill:none;
                            stroke:black; stroke-width:3"/>

                            There has also been discussion about CSS units perhaps "helping'". They
                            don't. CSS units have no effect on this issue. The rule in the SVG spec has
                            always been that CSS units get converted into equivalent user units using
                            some magic formulas, and then all rendering is done as if the equivalent
                            user units had been specified.

                            Jon Ferraiolo
                            SVG Editor
                            Adobe Systems Incorporated


                            At 07:22 AM 11/7/00 +0000, goessner@... wrote:
                            >wade,
                            >.. i remember .. i also considered something wrong with adobe
                            >viewer's result. maybe someone of adobes developers crew can comment
                            >this ..
                            >
                            >s.goessner
                            >
                            >--- In svg-developers@egroups.com, "Harrell, Wade" <wade@i...> wrote:
                            > > hmmmm, maybe I am seeing an issue with the Adobe viewer then. I
                            >tried all
                            > > three examples from that post and all three gave the same result. A
                            > > rectangle with 1px left & right but approx 10px top and bottom.
                            > >
                            > > Wade Harrell * Wade.Harrell@i...
                            > > Sr Content Engineer * Iguana Studios Inc
                            > > vox:212.209.1380 * fax:212.243.6506
                            > > 16 W 19th * 10th Floor
                            > > New York, NY 10011 - 4205
                            > > http://www.iguanastudios.com
                            > > Latitude: 40.739145 (40° 44' 20" N)
                            > > Longitude: -73.992089 (73° 59' 31" W)
                            > >
                            > > -----Original Message-----
                            > > From: goessner@m... [mailto:goessner@m...]
                            > > Sent: Monday, November 06, 2000 4:34 PM
                            > > To: svg-developers@egroups.com
                            > > Subject: [svg-developers] Re: stretched outline
                            > >
                            > >
                            > > some time ago i asked a similar question .. resolved by chris ..
                            > >
                            > > http://www.egroups.com/message/svg-developers/329
                            > >
                            > > hope that helps ..
                            > >
                            > > s.goessner
                            > >
                            > > --- In svg-developers@egroups.com, "Harrell, Wade" <wade@i...>
                            >wrote:
                            > > > This is a good question. In a few experiments I have been doing
                            > > with the
                            > > > file you linked I have been unable to apply a stroke to a scaled
                            > > object
                            > > > without that stroke being scaled as well. This poses a problem
                            >for
                            > > > instances where increasing the stroke-width on scale is
                            >undesirable.
                            > > >
                            > > > Does anyone else on the list have any insight into a solution for
                            > > locking
                            > > > the stroke-width regardless of the scale?
                            > > >
                            > > > Wade Harrell * Wade.Harrell@i...
                            > > > Sr Content Engineer * Iguana Studios Inc
                            > > > vox:212.209.1380 * fax:212.243.6506
                            > > > 16 W 19th * 10th Floor
                            > > > New York, NY 10011 - 4205
                            > > > http://www.iguanastudios.com
                            > > > Latitude: 40.739145 (40° 44' 20" N)
                            > > > Longitude: -73.992089 (73° 59' 31" W)
                            > > >
                            > > > -----Original Message-----
                            > > > From: Steve White [mailto:steve@V...]
                            > > > Sent: Monday, November 06, 2000 12:21 PM
                            > > > To: svg-developers@egroups.com
                            > > > Subject: [svg-developers] stretched outline
                            > > >
                            > > >
                            > > > I notice that when you transform (stretch) an element, it
                            >stretches
                            > > the
                            > > > outline. ex: http://www.virtualmechanics.com/test/stretch.svg I
                            > > don't
                            > > > suppose there is any simple way to prevent this?
                            > > >
                            > > > Yours Truly
                            > > >
                            > > > Steve White
                            > > > steve@V...
                            > > > www.VirtualMechanics.com
                            >
                            >
                            >
                          • Mika Heiskanen
                            ... Stroke-width did increase in any viewer in accorance with the previous SVG specification. This because the specification required using the nearest
                            Message 13 of 13 , Nov 12, 2000
                            • 0 Attachment
                              > This is a good question. In a few experiments I have been doing
                              > with the file you linked I have been unable to apply a stroke to
                              > a scaled object without that stroke being scaled as well.
                              > This poses a problem for instances where increasing the stroke-width
                              > on scale is undesirable.

                              Stroke-width did increase in any viewer in accorance with the
                              previous SVG specification. This because the specification
                              required using the nearest viewport definition in calculating
                              what 1px means. The form of the calculation was such that the
                              definition of 1px depends on sx and sy, the scale factors in
                              x- and y-directions.

                              The latest SVG specification has changed so that going back
                              to viewport coordinates and back is no longer necessary. However,
                              the list of changes clearly implies this is not enough to obtain
                              invariance across zoom levels, but more language features will
                              be needed in the future. Why, I am not certain. I had previously
                              thought removing the step to viewport and back would be enough to
                              obtain (nonuniform) scale invariant absolute units.

                              Here is the relevant clip from

                              http://www.w3.org/TR/2000/CR-SVG-20001102/changes.html

                              "Based on feedback from implementers that the absolute and percentage CSS
                              units specifiers were very difficult to implement and would cause major
                              impact on performance, and with the observation that the processing rules
                              for CSS units produced considerable confusion in the user community and
                              often did not produce the results users expected, the CSS unit processing
                              rules have been revamped to enable simpler implementation, faster
                              processing and more predictable behavior. With the new CSS unit
                              processing rules, an implementation no longer will have to bubble up to the
                              nearest viewport element and perform major computation to determine how
                              large "1px" is. The intent behind the old rules was to allow for certain
                              parts of the graphic (e.g., stroke widths or font sizes) to be invariant
                              across zoom levels, but the previous CSS unit processing rules did an
                              incomplete job of addressing these needs. The feeling is that the ability
                              to achieve invariance requires a more thorough feature set which will be
                              considered in a future version of the language. For now, developers will
                              have to use scripting to achieve invariance across zoom levels."

                              The new definition in

                              http://www.w3.org/TR/2000/CR-SVG-20001102/coords.html

                              refers to CSS2 processing rules, which in my understanding define
                              a visual pixel unit, which to my understanding should be invariant
                              under any transform operations. I am not quite sure why the new
                              specs then warn against using absolute units when transformations
                              are in effect. I had thought the whole idea of using absolute units
                              was to avoid any coordinate transformation effects on size.

                              Perhaps someone more knowledgeable on the matter could explain
                              what the end result is going to be?

                              --> Mika.Heiskanen@...
                            Your message has been successfully submitted and would be delivered to recipients shortly.