[f-spot: 5/41] UpdateMinZoom(). now it runs without crashing (still displaying nothing)



commit 324a12158137bdbb5d7f5519ee80c86c8af87fcc
Author: Stephane Delcroix <stephane delcroix org>
Date:   Sun Jun 7 09:42:03 2009 +0200

    UpdateMinZoom(). now it runs without crashing (still displaying nothing)

 src/Widgets/ImageView.cs |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/Widgets/ImageView.cs b/src/Widgets/ImageView.cs
index cbc0b8c..13a4370 100644
--- a/src/Widgets/ImageView.cs
+++ b/src/Widgets/ImageView.cs
@@ -189,9 +189,19 @@ namespace FSpot.Widgets
 
 		protected void UpdateMinZoom ()
 		{
-			throw new NotImplementedException ();	
-		}
+			if (Pixbuf == null)
+				min_zoom = 0.1;
+			else {
+				min_zoom = Math.Min (1.0,
+					Math.Min ((double)Allocation.Width / (double)Pixbuf.Width,
+					(double)Allocation.Height / (double)Pixbuf.Height));
+			}
 
+			// Since this affects the zoom_scale we should alert it
+			EventHandler eh = ZoomChanged;
+			if (eh != null)
+				eh (this, System.EventArgs.Empty);
+		}
 
 		public event EventHandler ZoomChanged;
 		public event EventHandler SelectionChanged;



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