diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index fbff919043..a798f6c44b 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,7 +1,7 @@ 1999-07-20 Mark Crichton - * src/gdk-pixbuf.c (gdk_pixbuf_rotate): Added translation to recenter - the pixbuf. Unfortunately, it doesn't work right yet. + * src/gdk-pixbuf.c (gdk_pixbuf_rotate): Fixed rotation. Now a bbox + calculation needs to be done. 1999-07-18 Larry Ewing diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c index 589d72fcba..c786c1ddf7 100644 --- a/gdk-pixbuf/gdk-pixbuf.c +++ b/gdk-pixbuf/gdk-pixbuf.c @@ -100,10 +100,17 @@ gdk_pixbuf_rotate (GdkPixBuf *pixbuf, gdouble angle) rot[3] = cos(rad); rot[4] = rot[5] = 0; + trans[0] = trans[3] = 1; + trans[1] = trans[2] = 0; + trans[4] = -(double)w / 2.0; + trans[5] = -(double)h / 2.0; + + art_affine_multiply(rot, trans, rot); + trans[0] = trans[3] = 1; trans[1] = trans[2] = 0; trans[4] = (double)w / 2.0; - trans[5] = 0; + trans[5] = (double)h / 2.0; art_affine_multiply(affine, rot, trans);