Hey guys,

I need to use Cairo for my college C project. My project consists in simulate Brownian movement and so I need to have lots of circles moving. But as this is very simple on other frameworks I've worked with (SDL, pygame), I do not understand how it's done in Cairo.

Here is my problem: I use
Code:
cairo_translate(cr, x, y)
to "move" my object within the drawing area. But as such, the referential for the other circles changes. I want to be able to change every circle independently from (0, 0) beign the upper left corner of the drawing area.


Code:
    genRandVector(numOfBalls);

    /* creates big ball */
    cairo_set_line_width(cr, 5);
    cairo_set_source_rgb(cr, 0, 0, 0);
    cairo_arc(cr, balls_MAP[0].x, balls_MAP[0].y, CONF.big_rad, 0, 2 * M_PI);

    cairo_stroke_preserve(cr);
    cairo_set_source_rgb(cr, 0.9, 0.9, 0.9);

    cairo_fill(cr);

    /* creates other balls */
    int i;
    cairo_close_path(cr);
    cairo_set_source_rgb(cr, 0, 0, 0);

    for(i = 1; i < numOfBalls; i++) {

        cairo_arc(cr, balls_MAP[i].x, balls_MAP[i].y, CONF.small_rad, 0, 2 * M_PI);
        cairo_stroke_preserve(cr);

        cairo_fill(cr);
        cairo_close_path(cr);
    }
At the moment all the circles are still. Thanks.