[gthumb] allow to rotate an image from -180 to 180 degrees



commit 1a083f57e87293b7d61d6fa88069382a04ae2738
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Wed Jul 4 17:12:49 2012 +0200

    allow to rotate an image from -180 to 180 degrees
    
    use the cairo ratation function, that supports angles greater then 90 degrees

 extensions/file_tools/gth-file-tool-rotate.c |    4 ++--
 extensions/file_tools/gth-image-rotator.c    |    6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/extensions/file_tools/gth-file-tool-rotate.c b/extensions/file_tools/gth-file-tool-rotate.c
index e58adf1..f84a860 100644
--- a/extensions/file_tools/gth-file-tool-rotate.c
+++ b/extensions/file_tools/gth-file-tool-rotate.c
@@ -240,7 +240,7 @@ apply_button_clicked_cb (GtkButton         *button,
 	GtkWidget       *window;
 	GtkWidget       *viewer_page;
 
-	image = gth_image_rotator_get_result (GTH_IMAGE_ROTATOR (self->priv->rotator), TRUE);
+	image = gth_image_rotator_get_result (GTH_IMAGE_ROTATOR (self->priv->rotator), FALSE);
 
 	window = gth_file_tool_get_window (GTH_FILE_TOOL (self));
 	viewer_page = gth_browser_get_viewer_page (GTH_BROWSER (window));
@@ -402,7 +402,7 @@ gth_file_tool_rotate_get_options (GthFileTool *base)
 
 	self->priv->rotation_angle_adj = gimp_scale_entry_new (GET_WIDGET ("rotation_angle_hbox"),
 							       GTK_LABEL (GET_WIDGET ("rotation_angle_label")),
-							       0.0, -90.0, 90.0, 0.1, 1.0, 1);
+							       0.0, -180.0, 180.0, 0.1, 1.0, 1);
 
 	self->priv->crop_p1_adj = gimp_scale_entry_new (GET_WIDGET ("crop_p1_hbox"),
 							GTK_LABEL (GET_WIDGET ("crop_p1_label")),
diff --git a/extensions/file_tools/gth-image-rotator.c b/extensions/file_tools/gth-image-rotator.c
index ebb6f9b..971c90e 100644
--- a/extensions/file_tools/gth-image-rotator.c
+++ b/extensions/file_tools/gth-image-rotator.c
@@ -570,7 +570,7 @@ gth_image_rotator_motion_notify (GthImageViewerTool *base,
 			angle2 = angle2 - G_2_PI;
 		angle = self->priv->angle_before_dragging + (angle2 - angle1);
 
-		g_signal_emit (self, signals[ANGLE_CHANGED], 0, CLAMP (RAD_TO_DEG (angle), -90.0, 90));
+		g_signal_emit (self, signals[ANGLE_CHANGED], 0, CLAMP (RAD_TO_DEG (angle), -180.0, 180));
 	}
 
 	return FALSE;
@@ -865,7 +865,9 @@ gth_image_rotator_get_result_fast (GthImageRotator *self)
 		self->priv->crop_region.height = clip_area.height;
 	}
 
-	output = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, self->priv->crop_region.width, self->priv->crop_region.height);
+	output = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+					     self->priv->crop_region.width,
+					     self->priv->crop_region.height);
 
 	/* set the device offset to make the clip area start from the top left
 	 * corner of the output image */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]