xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Haneman <Bill.Hane...@ireland.sun.com>
Subject [bugs] Filter bounds vs. getPrimitiveBounds
Date Tue, 12 Dec 2000 16:22:55 GMT
Hi:

The commit I made recently uncovers a problem with 
filters: namely, in the current implementation filters
use the geometry bounds of their source node(s)
rather than the primitive bounds.

If one considers that case of outlined or underlined
text, where the geometry bounds do not include the 
widening effect of stroking or text decoration, you 
can see the problem.  The filter bounds are not big enough 
to enclose the entire painted source.

It seems that this happens in a call to
SVGUtilities.convertRegion(...).

Changing SVGUtilities.convertRegion(...) to call
getPrimitiveBounds() rather than getGeometryBounds()
(and making a small fix to ConcreteShapeNode so that
a null bounding rectangle is never returned for non-null
shapes - otherwise patterns throw NPEs) yields the
correct behavior for filters, but causes patternRegions.svg
to regress.  

At this point I am out of my depth, since I have not
worked with the pattern and filter code and am not terribly
familiar with SVGUtilities.

I am seeking feedback as to where the fix should actually
be made, on the basis of what I have said.  The bottom line is
that filters should get their bounds from primitiveBounds and
not geometryBounds.  

A previous hack meant that text elements were returning the
same bounds for geometry and primitivebounds, but this is
of course not correct.

By the way, until we can fix this, filtering of underlined
text is broken.  (Filtering of heavily stroked shapes/text
has apparently been broken all along).

Thanks,

-Bill

------
Bill Haneman +353 1 8199279
Ireland Desktop Engineering
Sun Microsystems Ireland Ltd.


Mime
View raw message