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 Henryk Hecht <ml...@hhecht.e4ward.com> on 2013/07/26 06:49:21 UTC

patternContentUnits

In trying to get patternContentUnits-"objectBoundingBox" to work, I have 
found Batik a little unpredictable.  Minimal example:

<svg xmlns="http://www.w3.org/2000/svg">
   <defs>
     <pattern height="1" width="1" id="abc"
              patternContentUnits="objectBoundingBox">
       <rect fill="red" x="0" y="0" width="1" height="1"/>
       <line stroke-width=".1" stroke="black" x1="0" y1="0" x2="1" y2="1"/>
     </pattern>
   </defs>
   <rect fill="url(#abc)" x="200" y="150" width="700" height="200"
         stroke="black"/>
</svg>

The expected behavior is that the pattern-filled rectangle ought to appear 
the same regardless of position, and this is indeed what occurs in 
firefox, opera, and webkit.  In squiggle (Batik 1.7, on openjdk 1.7.0.6), 
however, the behavior is somewhat hard to characterize.  If one starts the 
rectangle out at 0,0, it appears almost properly, though the line's stroke 
looks distorted to me.  As one moves it down-and-right the pattern fill 
seems to progressively lead the rectangle until it eventually disappears. 
The above example is a half hour before sunset, so to speak.  Based on 
prior experience, it looks like a transform is getting miscalculated 
somewhere, but I haven't the experience to guess where.

I didn't find anything in Bugzilla, so is this a bug no one has found, or 
have I (and maybe the authors of several web browsers) just misunderstood 
the spec?

-- 
HH

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