On Thu, 2010-04-22 at 10:31 +0100, Neil Roberts wrote:
> Hi,
> 
> On Sam Wilson <[email protected]> wrote:
> > Hello, I hate to bother you all with trivial stuff like this, but I am
> > having some serious trouble finding the error in my program.
> > 
> > Essentially, I want to render a shape with a gradient background and a
> > text label, so I created an actor that has a single Text actor as a
> > child.
> > 
> > The gradient is rendered using a method similar to
> > http://lists.o-hand.com/clutter/1787.html written in vala and adapted to
> > handle angles.  (Any improvements to this function would also be welcome
> > C: )
> > 
> > A screenshot of the incorrect behaviour is located at
> > http://sellyourvote.ca/Screenshot-test.png
> > 
> > I know it has something to do with the Text actor, since both rectangles
> > render properly if the text is turned off in both of them.
> 
> I'm having trouble compiling your Vala sample so I can't test the
> theory,

Hmm... Might be the compiler version, I am using a recent build from
git, but 0.8.0 should also be able to compile it fine


>  but my guess is that the problem is because you're not setting a
> material before you paint the gradient. When you paint the first
> gradient on the left you will have the material left over from whatever
> was painted last in the previous scene. I think in this case that would
> be the text. Text is painted using a special material that I think would
> break your gradient. The second gradient works because it will use the
> material left over from painting the outline.
> 
> I think all it needs is this line at the top of your draw_gradient
> method:
> 
>   Cogl.set_source_color({128, 128, 128, 255})
> 
> - Neil
> 

You sir, are a god!  I can't believe that's all I was missing :P

Thanks,
Sam

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to