I have some SVG objects with a tiled image background using fill="url(#background) , where I define #background as a pattern containing only image .
However, when an object moves through the settings, its x / y attributes (or cx / cy or something else determines the offset), the background does not move with it.
How do I make a background move? From How to transfer an SVG template using an element I tried to set patternContentUnits='objectBoundingBox' , but it just turns the image into a solid color drop (oddly enough, though color according to the image, as if it were only the first pixel or some).
Here is a jsfiddle example that illustrates all of this: the top rect was turned solid, and then the bottom rect has a background image, but it doesn't move with rect :
http://jsfiddle.net/x8nkz/17/
I know that if you used transform="translate(...)" instead of setting the x / y attributes, the background is also translated, but the existing code base I work in does not use translation for positioning (and this would leave other unforeseen consequences for the rest of the application).
Thanks in advance for your help.
javascript svg
Yang
source share