You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "Grinvald, Edward" <Ed...@ca.com> on 2003/12/04 19:55:25 UTC

Batik doesn't render this properly

Hello all,
I have an image that renders well in ie (w/ adobe plug-in), and looks
completely different with batik. Does anyone know what the problem is?
 

Edward Grinvald
Software Engineer, BrightStor
Computer Associates International (<http://www.ca.com
<http://www.ca.com/> >)
One Computer Associates Plaza
Islandia, NY 11749
voice: (631) 342 6350
edward.grinvald@ca.com <ma...@ca.com> 

 

Re: Batik doesn't render this properly

Posted by Thomas DeWeese <Th...@Kodak.com>.
Grinvald, Edward wrote:

> I have an image that renders well in ie (w/ adobe plug-in), and looks 
> completely different with batik. Does anyone know what the problem is?

Hi Edward,

    The problem is the use of patternContentUnits="objectBoundingBox".
take the example from the specification:

<pattern x="10" y="10" width="20" height="20">
    <rect x="5" y="5" width="10" height="10"/>
</pattern>

    In this case the rectangle's top left corner is 5 pixels over/down
from the pattern tile's origin (this uses the default userSpaceOnUse
for patternContentUnits).

    But when you say "objectBoundingBox" this says that the coordinate
system (within the pattern tile) is established using the objects
bounding box.  So in this case 0,0 is mapped to the coordinates of
the object's upper left corner, _not_ to the tile's upper left corner.
In your case the objects upper left corner is not 0,0 so the pattern 
contents appear 'shifted' in Batik.  Adobe appears to ignore this
translation and only apply the scaling portion of the transform.

    The 'fix' for this is to use viewBox="0 0 1 1" 
preserveAspectRatio="none" which says map the coordinate space
0,0 -> 1,1 to what ever space x,y w,h define.  Which appears to be
what you want.

> Edward Grinvald
> *Software Engineer, BrightStor**
> *Computer Associates International (<***http://www.ca.com* 
> <http://www.ca.com/>*>)**
> *One Computer Associates Plaza *
> *Islandia* *, NY 11749 *
> *voice: (631) 342 6350*
> **edward.grinvald@ca.com* <ma...@ca.com>
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org