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

Re: [svg-developers] a build on (0,0)

Expand Messages
  • Jon Ferraiolo
    Jean-Yves, Did anyone respond to this yet? I believe the Adobe SVGViewer 2.0 beta is working correctly. The SVG specification says the following
    Message 1 of 5 , Jan 1, 2001
      Jean-Yves,
      Did anyone respond to this yet?

      I believe the Adobe SVGViewer 2.0 beta is working correctly. The SVG specification says the following (http://www.w3.org/TR/SVG/struct.html#UseElement):

      If the 'use' element references a 'symbol' element:

          In the generated content, the 'use' will be replaced by 'g', where all attributes from the 'use' element except for x, y, width, height and xlink:href are transferred to the generated 'g' element. An additional transformation translate(x,y) is appended to the end (i.e., right-side) of the transform attribute on the generated 'g', where x and y represent the values of the x and y attributes on the 'use' element. The referenced 'symbol' and its contents are deep-cloned into the generated tree, with the exception that the 'symbol' is replaced by an 'svg'. This generated 'svg' will always have explicit values for attributes width and height. If attributes width and/or height are provided on the 'use' element, then these attributes will be transferred to the generated 'svg'. If attributes width and/or height are not specified, the generated 'svg' element will use values of 100% for these attributes.

      Since the <use> elements below do not specify x/y/width/height values, then the effect is as if the <use> is replaced by:

         < g >
            < svg x="0%" y="0%" width="100%" height="100%" >
               < !-- contents of symbol go here -- >
            < /svg >
         < /g >

      element inside of the <use>. The <svg> element creates a temporary viewport, with default processing rules that cause clipping at the bounds of the viewport. (See http://www.w3.org/TR/SVG/masking.html#OverflowProperty).

      There are several ways to disable the automatic clipping:

      1) Put a style="overflow:hidden" setting on any <symbol> elements which you don't want to clip at the bounds of the temporary viewport (see http://www.w3.org/TR/SVG/masking.html#OverflowProperty).

      2) Put x/y/width/height attributes on the <use> element to force the temporary viewport to be large enough to accommodate the symbol.

      3) Move the origin of the coordinate system via a transform attribute (which you have done below)

      Jon Ferraiolo
      SVG Editor
      jferraio@...

      At 05:00 PM 11/21/00 +0100, Jean-Yves Deries wrote:
      Hi all,

       
      Using the Adobe SVGViewer 2.0 Beta
      I notice that I can't display anymore a <symbol>
      build on both sides of (0,0) coordonates
      when it is call by a <use xlink:href="mySymbol"/>
       
      It doesn't show the negatives parts.
       
      Is that a bug or a new deal ?
       
      thanks for your help
      jean-yves
       
       
      NB for better understanding,
      you can try this :
       
      <?xml version="1.0" standalone="no"?>
      <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN" "http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd">

       
      <svg width="1200" height="600" viewBox="0 0 1200 600" >
       <defs>
        <symbol id="aReferenceMark0">
         <path style="fill:none;stroke:navy;stroke-with:1" d="M0,-50V50"/>
         <path style="fill:none;stroke:navy;stroke-with:1" d="M-50,0H50"/>
        </symbol>
        <symbol id="aReferenceMark">
         <path style="fill:none;stroke:navy;stroke-with:1" d="M100,50V150"/>
         <path style="fill:none;stroke:navy;stroke-with:1" d="M50,100H150"/>
        </symbol>
        <symbol id="aRectangle0">
         <rect x="-30" y="-30" width="60" height="60" rx="10" style="fill:#FFCC33;stroke:navy;stroke-width:4"/>
        </symbol>
        <symbol id="aRectangle">
         <rect x="70" y="70" width="60" height="60" rx="10" style="fill:#FFCC33;stroke:navy;stroke-width:4"/>
        </symbol>
        <symbol id="anArrow0">
         <path d="M-12,24L0,0L12,24z" style="fill:navy;stroke:#CC6633;stroke-width:4;stroke-linejoin:miter;"/>
        </symbol>
        <symbol id="anArrow">
         <path d="M88,124L100,100L112,124z" style="fill:navy;stroke:#CC6633;stroke-width:4;stroke-linejoin:miter;"/>
        </symbol>
        </defs>

       

      <g transform="translate(200,200)">
      <use xlink:href="#aReferenceMark0" />
      <use xlink:href="#aRectangle0" />
      <use xlink:href="#anArrow0" />
      <text x="0" y="70" style ="font-style:arial;font-size:12;fill:black;text-anchor:middle;">
      with symbols centered on (0,0)</text>
      </g>
       
      <g transform="translate(300,100)">
      <use xlink:href="#aReferenceMark" />
      <use xlink:href="#aRectangle" />
      <use xlink:href="#anArrow" />
      <text x="100" y="170" style ="font-style:arial;font-size:12;fill:black;text-anchor:middle;">
      with symbols centered on (100,100)</text>
      </g>
       
      </svg>

       
       

      eGroups Sponsor
    Your message has been successfully submitted and would be delivered to recipients shortly.