f-spot r4338 - in trunk: . src



Author: sdelcroix
Date: Mon Sep 15 08:14:58 2008
New Revision: 4338
URL: http://svn.gnome.org/viewvc/f-spot?rev=4338&view=rev

Log:
2008-09-15  Stephane Delcroix  <sdelcroix novell com>

	* src/PhotoImageView.cs: fix the ZoomFit, bgo #551741.


Modified:
   trunk/ChangeLog
   trunk/src/PhotoImageView.cs

Modified: trunk/src/PhotoImageView.cs
==============================================================================
--- trunk/src/PhotoImageView.cs	(original)
+++ trunk/src/PhotoImageView.cs	Mon Sep 15 08:14:58 2008
@@ -386,24 +386,19 @@
 			if (pixbuf == null)
 				return;
 
-			int available_width = this.Allocation.Width;
-			int available_height = this.Allocation.Height;
-		
+			if (scrolled != null)
+				scrolled.SetPolicy (Gtk.PolicyType.Never, Gtk.PolicyType.Never);
+
+			int available_width = (scrolled != null) ? scrolled.Allocation.Width : this.Allocation.Width;
+			int available_height = (scrolled != null) ? scrolled.Allocation.Height : this.Allocation.Height;
+
 			double zoom_to_fit = ZoomUtils.FitToScale ((uint) available_width, 
 								   (uint) available_height,
 								   (uint) pixbuf.Width, 
 								   (uint) pixbuf.Height, 
 								   upscale);
-			
-			double image_zoom = zoom_to_fit;
-			/*
-			System.Console.WriteLine ("Zoom = {0}, {1}, {2}", image_zoom, 
-						  available_width, 
-						  available_height);
-			*/
 
-			if (scrolled != null)
-				scrolled.SetPolicy (Gtk.PolicyType.Never, Gtk.PolicyType.Never);
+			double image_zoom = zoom_to_fit;
 
 			this.SetZoom (image_zoom, image_zoom);
 			



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