[f-spot] fix the crop helpers



commit a3da52af5285a7c65d966cee8b6e29f83c36a18e
Author: Stephane Delcroix <stephane delcroix org>
Date:   Wed Jul 15 09:31:28 2009 +0200

    fix the crop helpers
    
    fix the dashed crop helpers for images that aren't TopLeft oriented

 src/Widgets/ImageView.cs |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/Widgets/ImageView.cs b/src/Widgets/ImageView.cs
index 80f3877..006d1cb 100644
--- a/src/Widgets/ImageView.cs
+++ b/src/Widgets/ImageView.cs
@@ -280,8 +280,8 @@ namespace FSpot.Widgets
 			int x_offset = scaled_width < Allocation.Width ? (int)(Allocation.Width - scaled_width) / 2 : -XOffset;
 			int y_offset = scaled_height < Allocation.Height ? (int)(Allocation.Height - scaled_height) / 2 : -YOffset;
 
-			return new Point ((int) Math.Floor (image.X * (double) (scaled_width - 1) / (Pixbuf.Width - 1) + 0.5) + x_offset,
-					  (int) Math.Floor (image.Y * (double) (scaled_height - 1) / (Pixbuf.Height - 1) + 0.5) + y_offset);
+			return new Point ((int) Math.Floor (image.X * (double) (scaled_width - 1) / (((int)pixbuf_orientation <= 4 ? Pixbuf.Width : Pixbuf.Height) - 1) + 0.5) + x_offset,
+					  (int) Math.Floor (image.Y * (double) (scaled_height - 1) / (((int)pixbuf_orientation <= 4 ? Pixbuf.Height : Pixbuf.Width) - 1) + 0.5) + y_offset);
 		}
 
 		protected Rectangle ImageCoordsToWindow (Rectangle image)
@@ -889,7 +889,9 @@ namespace FSpot.Widgets
 				CairoHelper.Region (ctx, evnt.Region);
 				ctx.Fill ();
 
+				ctx.SetSourceRGBA (.7, .7, .7, .8);
 				ctx.SetDash (new double [] {10, 15}, 0);
+				ctx.LineWidth = .8;
 				for (int i=1; i<3; i++) {
 					Point s = ImageCoordsToWindow (new Point (selection.X + selection.Width / 3 * i, selection.Y));
 					Point e = ImageCoordsToWindow (new Point (selection.X + selection.Width / 3 * i, selection.Y + selection.Height));



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