[f-spot] Fix rotation when we don't know the orientation.



commit c7f8c1fce7257435918858b79541b64da8e340ca
Author: Ruben Vermeersch <ruben savanne be>
Date:   Sat Sep 11 22:14:44 2010 +0200

    Fix rotation when we don't know the orientation.

 src/Core/FSpot.Utils/FSpot.Utils/PixbufUtils.cs |   36 ++++++++++++----------
 1 files changed, 20 insertions(+), 16 deletions(-)
---
diff --git a/src/Core/FSpot.Utils/FSpot.Utils/PixbufUtils.cs b/src/Core/FSpot.Utils/FSpot.Utils/PixbufUtils.cs
index 4964a85..69e5cb8 100644
--- a/src/Core/FSpot.Utils/FSpot.Utils/PixbufUtils.cs
+++ b/src/Core/FSpot.Utils/FSpot.Utils/PixbufUtils.cs
@@ -18,22 +18,26 @@ namespace FSpot.Utils
 {
 	public static class PixbufUtils
 	{
-		static public ImageOrientation Rotate270 (ImageOrientation orientation)
-		{
-			ImageOrientation [] rot = new ImageOrientation [] {
-				ImageOrientation.LeftBottom,
-				ImageOrientation.LeftTop,
-				ImageOrientation.RightTop,
-				ImageOrientation.RightBottom,
-				ImageOrientation.BottomLeft,
-				ImageOrientation.TopLeft,
-				ImageOrientation.TopRight,
-				ImageOrientation.BottomRight
-			};
-	
-			orientation = rot [((int)orientation) -1];
-			return orientation;
-		}
+        static public ImageOrientation Rotate270 (ImageOrientation orientation)
+        {
+            if (orientation == ImageOrientation.None) {
+                orientation = ImageOrientation.TopLeft;
+            }
+
+            ImageOrientation [] rot = new ImageOrientation [] {
+                ImageOrientation.LeftBottom,
+                    ImageOrientation.LeftTop,
+                    ImageOrientation.RightTop,
+                    ImageOrientation.RightBottom,
+                    ImageOrientation.BottomLeft,
+                    ImageOrientation.TopLeft,
+                    ImageOrientation.TopRight,
+                    ImageOrientation.BottomRight
+            };
+
+            orientation = rot [((int)orientation) -1];
+            return orientation;
+        }
 	
 		static public ImageOrientation Rotate90 (ImageOrientation orientation)
 		{



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