[f-spot] Change upscale to a property such that it shouldn't be passed to ZoomFit.



commit 808007a2624613d38e3966eb23efb177babf3694
Author: Ruben Vermeersch <ruben savanne be>
Date:   Thu Jul 23 19:53:37 2009 +0200

    Change upscale to a property such that it shouldn't be passed to ZoomFit.
    
    It's a value that's dependent on the image loaded, not on how we
    ZoomFit.

 src/Widgets/ImageView.cs |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/src/Widgets/ImageView.cs b/src/Widgets/ImageView.cs
index 66a397f..c61e7e0 100644
--- a/src/Widgets/ImageView.cs
+++ b/src/Widgets/ImageView.cs
@@ -53,6 +53,7 @@ namespace FSpot.Widgets
 
 			Pixbuf = pixbuf;
 			PixbufOrientation = orientation;
+			Upscale = upscale;
 
 			ComputeMinZoom ();
 			ComputeScaledSize ();
@@ -62,7 +63,7 @@ namespace FSpot.Widgets
 				Hadjustment.Value = Vadjustment.Value = 0;
 				XOffset = YOffset = 0;
 				AdjustmentsChanged += ScrollToAdjustments;
-				ZoomFit (upscale);
+				ZoomFit ();
 			} else {
 				// TODO: Recalculate the adjustments and offsets such that the
 				// view on the image is maintained.
@@ -204,7 +205,7 @@ namespace FSpot.Widgets
 			get { return fit; } 
 		}
 
-		void ZoomFit (bool upscale)
+		public void ZoomFit ()
 		{
 			Gtk.ScrolledWindow scrolled = Parent as Gtk.ScrolledWindow;
 			if (scrolled != null)
@@ -212,8 +213,6 @@ namespace FSpot.Widgets
 			
 			ComputeMinZoom ();
 
-			this.upscale = upscale;
-
 			fit = true;
 			DoZoom (MIN_ZOOM, false, 0, 0);
 
@@ -275,11 +274,8 @@ namespace FSpot.Widgets
 			get { return min_zoom; }
 		}
 
-		bool upscale;
-		protected void ZoomFit ()
-		{
-			ZoomFit (upscale);
-		}
+
+		bool Upscale { get; set; }
 
 		protected virtual void ApplyColorTransform (Pixbuf pixbuf)
 		{
@@ -438,7 +434,7 @@ namespace FSpot.Widgets
 			base.OnSizeAllocated (allocation);
 
 			if (fit)
-				ZoomFit (upscale);
+				ZoomFit ();
 		}
 
 		protected override bool OnExposeEvent (Gdk.EventExpose evnt)
@@ -853,7 +849,7 @@ namespace FSpot.Widgets
 				height = Pixbuf.Width;
 			}
 
-			if (upscale)
+			if (Upscale)
 				min_zoom = Math.Min ((double)Allocation.Width / width,
 									 (double)Allocation.Height / height);
 			else



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