gnome_canvas_item_rotate?



All,
  What happened to gnome_canvas_item_rotate? It is in gnome-canvas.h
but not in gnome-canvas.c. Was this just an oversight, or did you want
it
removed? Anyway, since it seems useful and was trivial to do, I included
it here.

Note that I'm not sure this works for imlib stuff (perhaps only with
AA?),
but it works for the GdkPixbuf which is a good reason to convert anyway
:)


 -SOTTEK



/**
 * gnome_canvas_item_rotate:
 * @item: A canvas item.
 * @x: X coordinate.
 * @y: Y coordinate.
 * @angle: Amount to rotate
 *
 * Rotates a canvas item by @angle degrees about an arbitrary point
located
 * at the coordinate @x , @y in the @item's coordinate system.
 **/

void gnome_canvas_item_move (GnomeCanvasItem *item, double x, double y,
	double angle)
{
        double affine1[6];
        double affine2[6];

        g_return_if_fail (item != NULL);
        g_return_if_fail (GNOME_IS_CANVAS_ITEM (item));

        art_affine_translate(affine1, -x, -y);
        art_affine_rotate(affine2, angle);
        art_affine_multiply(affine1, affine1, affine2);
        art_affine_translate(affine2, x, y);
        art_affine_multiply(affine1, affine1, affine2);
        gnome_canvas_item_affine_relative(item,affine1);

}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]