[f-spot] validate values



commit 14008bcc00e0e32a066473070c7cfc386af52ae6
Author: Stephane Delcroix <stephane delcroix org>
Date:   Mon Apr 27 15:38:51 2009 +0200

    validate values
---
 src/Widgets/Filmstrip.cs |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/Widgets/Filmstrip.cs b/src/Widgets/Filmstrip.cs
index 1eae0b7..b916906 100644
--- a/src/Widgets/Filmstrip.cs
+++ b/src/Widgets/Filmstrip.cs
@@ -271,6 +271,13 @@ namespace FSpot.Widgets
 				return position; 
 			}
 			set {
+				if (value == position)
+					return;
+				if (value < 0)
+					value = 0;
+				if (value > selection.Collection.Count - 1)
+					value = selection.Collection.Count - 1;
+
 				animation.From = position;
 				animation.To = value;
 				animation.Restart ();



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