]> Pileus Git - ~andy/gtk/commitdiff
More fixes to the rotation code. It really works well now. Now we need to
authorMark Crichton <crichton@src.gnome.org>
Tue, 20 Jul 1999 19:30:08 +0000 (19:30 +0000)
committerMark Crichton <crichton@src.gnome.org>
Tue, 20 Jul 1999 19:30:08 +0000 (19:30 +0000)
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
gdk-pixbuf/gdk-pixbuf.c

index fbff919043eb92c06ae7ef420c20fa7a03af6a37..a798f6c44b7b0c3178ad403b61fa279236a87810 100644 (file)
@@ -1,7 +1,7 @@
 1999-07-20  Mark Crichton  <crichton@gimp.org>
 
-       * 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  <lewing@gimp.org>
 
index 589d72fcba906f9b406fda0e31885b0c37c0f5c0..c786c1ddf7a1e29ce7ee2bb582833198bf8a67a5 100644 (file)
@@ -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);