W3C home > Mailing lists > Public > www-svg@w3.org > July 2004

gradientUnits="objectBoundingBox"/SVGAnimatedLength problem

From: Alex Fritze <alex@croczilla.com>
Date: Thu, 15 Jul 2004 12:47:27 +0100
Message-ID: <40F66ECF.7080301@croczilla.com>
To: www-svg@w3.org


The SVGLinearGradientElement interfaces specifies that x1, y1, x2 and y2 
are of type SVGAnimatedLength.
The specs further say:
" If patternUnits="userSpaceOnUse", x, y, width, height represent values 
in the coordinate system that results from taking the current user 
coordinate system in place at the time when the 'pattern' element is 
referenced (i.e., the user coordinate system for the element referencing 
the 'pattern' element via a 'fill' 
or 'stroke' 
property) and then applying the transform specified by attribute 
"Percentages are allowed for *x1, y1, x2, y2*. For 
gradientUnits="userSpaceOnUse", percentages represent values relative to 
the current viewport. For gradientUnits="objectBoundingBox", percentages 
represent values relative to the bounding box for the object."

Now consider a gradient referenced by several elements:

    <linearGradient id="MyGradient" x2="50%">
      <stop offset="5%" stop-color="#F60" />
      <stop offset="95%" stop-color="#FF6" />
    <rect fill="url(#MyGradient)" stroke="black" stroke-width="5"
               x="100" y="100" width="600" height="200"/>
    <rect fill="url(#MyGradient)" stroke="black" stroke-width="5"
               x="100" y="400" width="60" height="20"/>

My problem is, what value should the following expression yield:

Should it be 300 or 30 or 0.5, or throw an error even?

Received on Thursday, 15 July 2004 08:47:35 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:02 UTC