Diff of /cbrpager-maemo/branches/MAEMO_0_9_20/src/gtkimageview.c [r19] .. [r20] Maximize Restore

  Switch to side-by-side view

--- a/cbrpager-maemo/branches/MAEMO_0_9_20/src/gtkimageview.c
+++ b/cbrpager-maemo/branches/MAEMO_0_9_20/src/gtkimageview.c
@@ -1558,22 +1558,18 @@
 gtk_image_view_rotate    (GtkImageView *view, 
                           int angle)
 {
+    gboolean fitting;
+    int old_angle;
     g_return_if_fail(GTK_IS_IMAGE_VIEW (view));
     if(view->rotate_value == angle)
         return;
-    view->rotate_value += angle;
+    fitting = gtk_image_view_get_fitting(view);
+    old_angle = view->rotate_value;
+    /* fool set pixbuf in rotating to the correct angle */
+    view->rotate_value = angle;
+    gtk_image_view_set_pixbuf(view, view->pixbuf, fitting);
+    view->rotate_value = old_angle + angle;
     view->rotate_value %= 360;
-    if(view->pixbuf) 
-    {
-        GdkPixbuf* rotated = gdk_pixbuf_rotate_simple(view->pixbuf, angle);
-        if(rotated != NULL)
-        {
-            g_object_unref(view->pixbuf);
-            view->pixbuf = rotated;
-        }
-        if(gtk_image_view_get_fitting(view))
-            gtk_image_view_set_fitting(view, TRUE);
-    }
 }
 
 /**
@@ -1587,23 +1583,17 @@
 gtk_image_view_rotate_cancel(GtkImageView *view)
 {
     int angle;
+    gboolean fitting;
     
     g_return_if_fail(GTK_IS_IMAGE_VIEW (view));
     if(view->rotate_value == 0)
         return;
+    fitting = gtk_image_view_get_fitting(view);
     angle = 360 - view->rotate_value;
+    /* fool set pixbuf in rotating to the correct angle */
+    view->rotate_value = angle;
+    gtk_image_view_set_pixbuf(view, view->pixbuf, fitting);
     view->rotate_value = 0;
-    if(view->pixbuf) 
-    {
-        GdkPixbuf* rotated = gdk_pixbuf_rotate_simple(view->pixbuf, angle);
-        if(rotated != NULL)
-        {
-            g_object_unref(view->pixbuf);
-            view->pixbuf = rotated;
-        }
-        if(gtk_image_view_get_fitting(view))
-            gtk_image_view_set_fitting(view, TRUE);
-    }
 }
 
 /**