I found the answer:
Patterns use offsets, and not origins. So, to simulate centering a pattern, consider the following requirements:
- The center is at half-width of the object.
- To be centered, the pattern object must be at the center point at half it's width.
pattern = new fabric.Pattern({
source: function () {[...]},
repeat: 'repeat',
offsetX: [objectwidth/2] - [patternwidth/2],
offsetY: [objectheight/2] - [patternheight/2]
});
That did it! If you changed the scale on either of the items, you will need to compensate for that as well.