W3C home > Mailing lists > Public > www-svg@w3.org > June 2009

Re: SVG filters feOffset and primitiveUnits

From: Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de>
Date: Fri, 12 Jun 2009 21:10:25 +0200
To: www-svg@w3.org, vbs85@gmx.de
Message-Id: <200906122110.26385.Dr.O.Hoffmann@gmx.de>
Hello,

just my personal observations:


http://www.w3.org/TR/SVG11/coords.html#ObjectBoundingBox
[
'filter' primitiveUnits="objectBoundingBox":	
Indicates that the various length values within the filter primitives 
represent fractions or percentages of the bounding box of the element to 
which the filter is applied.
]

Therefore these are never pixels.
Because it is defined
dx = "<number>"
and number has no 'unit' like '%' :
http://www.w3.org/TR/SVG11/types.html#DataTypeNumber
therefore this attribute can only be used to provide a fraction 
of the width of the boundingBox.

Therefore, if the boundingBox has a width of 100px,
dx = "0.25" means 25px because 100px * 0.25 = 25px

But indeed the cited text above may create some confusion
and may lead to another interpretation, that the number 
means percentages and the 'unit' is implied, then the 
calculation is 100px * 0.25% = 100px * 0.25/100 = 0.25px.

However, because there is no possibility for authors to
distinguish between percentage and a fraction with only
providing a number, the second interpretation is wrong,
but a clarification could be useful in the next specification.
For example the SVG tiny 1.2 specification notes only
fractions for objectBoundingBox (but it has no filter an
not many possibilities to specify percentages in general).

The new filter draft talks about fractions and percentages
too:
http://www.w3.org/TR/2007/WD-SVGFilter12-20070501/#FilterElementPrimitiveUnitsAttribute
but dx and dy are still numbers:
http://www.w3.org/TR/2007/WD-SVGFilter12-20070501/#feOffsetElement
therefore with this draft no change, but there is no new draft concerning the
definition of the boundingBox for the full 1.2 profile currently...
Received on Friday, 12 June 2009 18:04:48 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:42 GMT