W3C home > Mailing lists > Public > www-svg@w3.org > April 2010

Re: Margins for filters?

From: Jasper van de Gronde <th.v.d.gronde@hccnet.nl>
Date: Sun, 18 Apr 2010 16:44:55 +0200
Message-ID: <4BCB1AE7.3000308@hccnet.nl>
To: Dirk Schulze <vbs85@gmx.de>
CC: robert@ocallahan.org, Erik Dahlstrom <ed@opera.com>, www-svg@w3.org
Dirk Schulze wrote:
> I don't want to distract from filters. But another point, that I don't
> understand in this discussion about margin, is masking. Doesn't masking
> have the same problem?
> <svg xmlns="http://www.w3.org/2000/svg"
> xmlns:xlink="http://www.w3.org/1999/xlink">
> <defs>
> <mask id="mask">
>   <circle cx="50" cy="50" r="50" fill="white"/>
> </mask>
> </defs>
> <line x1="0" y1="50" x2="100" y2="50" stroke-width="100" stroke="green"
> mask="url(#mask)"/>
> <rect x="0" y="0" width="100" height="100" fill="green"
> mask="url(#mask)" transform="translate(100,0)"/>
> </svg>
> We only see one green circle, because the boundingBox of the line has a
> height of zero. So why fix this "issue" on filters with margin, but not
> on masking?

This is actually a slightly different issue, but to some extent you're 

The problem here (which currently also happens with filters btw) is that 
stroke isn't taken into account when computing the bounding box. This is 
perhaps strange in some cases, but definitely distinct from determining 
the region needed to properly display/compute the filter.

When completely eradicating the filter effects region (and doing the 
same for masks) this more or less ceases to be a problem, as the 
"bounding box" would be fully automatic anyway (which is not a big 
problem), and would include the stroke. It may in some cases make 
calculations a bit more difficult, but it GREATLY simplifies the overall 
implementation, as well as being a LOT more intuitive to use.
Received on Sunday, 18 April 2010 14:45:31 UTC

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