From: Jim Evins Date: Mon, 11 Nov 2002 22:27:29 +0000 (+0000) Subject: Workaround for flipping/rotation problem for gdkpixbuf items. See libgnomecanvas... X-Git-Tag: glabels-2_3_0~710 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=09c923e6b7ea8b9f1dd47cb52489c47361ec6a1f;p=glabels Workaround for flipping/rotation problem for gdkpixbuf items. See libgnomecanvas bug #97604. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@177 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/src/view-object.c b/glabels2/src/view-object.c index 1317b73a..c718e65d 100644 --- a/glabels2/src/view-object.c +++ b/glabels2/src/view-object.c @@ -27,6 +27,13 @@ #include "debug.h" +/*========================================================*/ +/* Private constants and macros. */ +/*========================================================*/ + +/* Used for a workaround for a bug with images when flipped or rotated by 90 degrees. */ +#define DELTA_DEG 0.0001 + /*========================================================*/ /* Private types. */ /*========================================================*/ @@ -560,7 +567,7 @@ static void flip_rotate_object_cb (glLabelObject *object, glViewObject *view_object) { - gdouble affine[6]; + gdouble affine[6], delta_affine[6]; gdouble w, h; GList *p, *item_list; GnomeCanvasItem *item; @@ -568,6 +575,11 @@ flip_rotate_object_cb (glLabelObject *object, gl_debug (DEBUG_VIEW, "START"); gl_label_object_get_applied_affine (object, affine); + + /* Apply a very small rotation, fixes problems with flipped or rotated images */ + art_affine_rotate (delta_affine, DELTA_DEG); + art_affine_multiply (affine, affine, delta_affine); + item_list = GNOME_CANVAS_GROUP(view_object->private->group)->item_list; for ( p=item_list; p != NULL; p=p->next ) { item = GNOME_CANVAS_ITEM(p->data);