[cairo] Cairo is non-deterministic?
Dirk Schönberger
dirk.schoenberger at sz-online.de
Mon Jan 2 06:43:33 PST 2006
>>
>> save()
>> translate(*self.border_pos)
>> translate(200, 30)
>>
>> # draw up
>> save()
>> new_path()
>> rel_line_to(0, -100)
>> stroke()
>> restore()
>>
>> # draw line
>> save()
>> new_path()
>> rel_line_to(...) # draw your line bits
>> stroke()
>> restore()
>>
>> Note that the new_path()'s aren't strictly necessary, but it's good
>> defensive programming in case someone left a path in the context
>> you're drawing to.
>
>
>
> This doesn't work at all :(
>
If cairo shows any resemblance to Postscript rendering model, new_path
cleans the starting point, so the line_to calls should fail.
So in order to get results, you should add a call to
moveto after the new_path calls.
Regards
Dirk
More information about the cairo
mailing list