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

SVG filters feOffset and primitiveUnits

From: Dirk Schulze <vbs85@gmx.de>
Date: Fri, 12 Jun 2009 18:37:40 +0200
To: www-svg@w3.org
Message-Id: <1244824660.4383.7.camel@dirk-laptop>

I have a question to feOffset in SVG filters
( http://www.w3.org/TR/SVG11/filters.html#feOffset ).

dx and dy depend on primitiveUnits. But what does it mean?
Does it mean that if primitiveUnits is objectBoundingBox, the number
given to dx and dy are interpreted as percentage or still as "pixel"?

Short example:

<?xml version="1.0" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" id="body" width="450"
height="500" viewBox="0 0 450 500">
    <g id="testContent" class="legend" style="text-anchor:middle">
            <filter id="tile_1" primitiveUnits="objectBoundingBox"
x="0%" y="0%" width="200%" height="200%">
                <feOffset x="-50%" y="-50%" width="100%" height="100%"/>
                <feOffset dx=".25"/>
        <rect x="0" y="0" width="100" height="100" style="fill:black;"/>
        <rect x="50" y="50" width="200" height="200"
        <rect x="50" y="50" width="100" height="100" style="fill:red;

Firefox interprets dx="0.25" as 25% of the width of the referenced Image
and moves the previous filter primitive 25 pixel to the right.
Batik interprets it as 0.25 pixel and moves the output of the previous
filter primitive 0.25 pixel to the right side.

What is the right behavior?

Received on Friday, 12 June 2009 16:38:21 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:17 UTC