[Rawstudio-commit] r3843 - trunk/plugins/rotate

Klaus Post klauspost at gmail.com
Sun Mar 6 20:54:43 CET 2011


Author: post
Date: 2011-03-06 20:54:43 +0100 (Sun, 06 Mar 2011)
New Revision: 3843

Modified:
   trunk/plugins/rotate/rotate.c
Log:
Don't keep re-rotating images that have negative angle of rotation.

Modified: trunk/plugins/rotate/rotate.c
===================================================================
--- trunk/plugins/rotate/rotate.c	2011-03-06 18:02:01 UTC (rev 3842)
+++ trunk/plugins/rotate/rotate.c	2011-03-06 19:54:43 UTC (rev 3843)
@@ -146,16 +146,21 @@
 {
 	RSRotate *rotate = RS_ROTATE(object);
 
+	float new_angle = 0.0f;
+
 	switch (property_id)
 	{
 		case PROP_ANGLE:
-			if (rotate->angle != g_value_get_float(value))
+
+			new_angle = g_value_get_float(value);
+			while(new_angle < 0.0)
+				new_angle += 360.0;
+
+			if (rotate->angle != new_angle)
 			{
-				rotate->angle = g_value_get_float(value);
+				rotate->angle = new_angle;
 
 				/* We only support positive */
-				while(rotate->angle < 0.0)
-					rotate->angle += 360.0;
 
 				rotate->dirty = TRUE;
 				rs_filter_changed(RS_FILTER(object), RS_FILTER_CHANGED_DIMENSION);




More information about the Rawstudio-commit mailing list