From 276ec82df598efc5a50b178dfcc45cf463f8ae9f Mon Sep 17 00:00:00 2001 From: Mark Crichton Date: Tue, 20 Jul 1999 19:30:08 +0000 Subject: [PATCH] More fixes to the rotation code. It really works well now. Now we need to More fixes to the rotation code. It really works well now. Now we need to fix the "clipping when rotating" problem if it is a real issue. Mark --- gdk-pixbuf/ChangeLog | 4 ++-- gdk-pixbuf/gdk-pixbuf.c | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) 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);