On 12/4/06, <b class="gmail_sendername">Carl Worth</b> <<a href="mailto:cworth@cworth.org">cworth@cworth.org</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Mon, 04 Dec 2006 13:01:13 +0000, Damon Chaplin wrote:<br>> If you were using pieces on a chess board, you'd use each piece's<br>> transform to position it within the board, then<br>> goo_canvas_item_animate() would do what you want.
<br><br>OK. So maybe it would make sense to update demo-item.c to position<br>itself with the matrix instead. (I was just using the implementation<br>of the demo as documentation so far and I found the non-matrix<br>positioning in
demo-item.c and the use of goo_canvas_item_animate<br>elsewhere, and got confused when the didn't work together.)<br><br>> (The current documentation is slightly wrong, though, so I'll fix that -<br>> the arguments passed in are used for the final transformation matrix,
<br>> not as offsets from the current one.)<br><br>Wait, which function is documented incorrectly? Is that animate or<br>translate? That sounds like the "relative vs. absolute" problems I ran<br>into.</blockquote>
<div><br> I have to agree I often have found goo_canvas_item_translate() a pretty useless method (at least so far), and so I end up doing something like:<br><br> def _move_to(self, x, y):<br> self.x = x<br>
self.y = y<br> M = cairo.Matrix()<br> M.translate(self.x, self.y)<br> self.set_transform(M)<br><br></div></div> Hope it helps.<br> <br>-- <br>Gustavo J. A. M. Carneiro<br>"The universe is always one step beyond logic."