Do MeshGradients not respect cairo_pattern_set_extend() ?

Travis Griggs <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
First of all. Mucho HUGE Gracias to those who pushed the mesh gradient stuff in. I've been waiting for this for a while. It is tres cool!

I'm playing a little with them in the updated 1.12.0 binding for Smalltalk and it's fun what you can do. I've had luck using them with ImageSurfaces. But not with a Quartz windows surface yet. BUT… that may be a side effect of the Smalltalk virtual machine, need to look into that some more. And it may be that it's because I'm using a binary that appears to have been just a bit before 1.12.0 was finally pushed out, so maybe there's an issue there.

What I did notice with ImageSurface and MeshGradient though, is that it doesn't seem to matter what I set using cairo_pattern_set_extend(), it's always just bound by the patch. Is that to be expected? Here's the code I used (it's Smalltalk, but I think the general jst there)

image := ImageSurface format: CairoFormat argb32 extent: 400 @ 400.
box := Point zero extent: image extent.
image newCairoContextWhile: 
		[:cr |
		mesh := MeshGradient new.
		mesh patchWhile: 
				[mesh moveTo: box topCenter.
				mesh lineTo: box rightCenter.
				mesh lineTo: box bottomCenter.
				mesh lineTo: box leftCenter.
				#(#red #green #blue #yellow)
					keysAndValuesDo: [:index :name | mesh setCorner: index color: (ColorValue perform: name)].
				mesh setControlPoint: 1 point: box topLeft.
				mesh setControlPoint: 2 point: box topRight.
				mesh setControlPoint: 3 point: box bottomRight.
				mesh setControlPoint: 4 point: box bottomLeft].
		mesh extend: ExtendStyle pad. "<<<<---THIS LINE RIGHT HERE"
		cr source: mesh.
		cr paint].
image writeToPng: '/Users/travis/Desktop/mesh.png'

That marked line, I've tried all 4 different ExtendStyles (reflect, none, pad, repeat), they all seem to basically do the same thing. I guess I naively expected, for example, that if I put repeat in there, it would tile my diamond (see attached output). Is it because the patches don't indicate an implicit symmetry whereby to apply the extending?

--
Travis Griggs
Objologist
"The best way to know you have a mind is to change it" -Judge Pierre Level

--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.