gtk+ r21012 - in trunk: . gtk



Author: mitch
Date: Tue Aug  5 14:25:29 2008
New Revision: 21012
URL: http://svn.gnome.org/viewvc/gtk+?rev=21012&view=rev

Log:
2008-08-05  Michael Natterer  <mitch imendio com>

	* gtk/gtkadjustment.c (gtk_adjustment_set_value): clamp the value
	to [lower...upper-page_size] instead of only [lower...upper].

	* README: add note about this change.

	While this fix is correct and should have been there forever, it
	has the potential to break some corner cases, however these cases
	would set page_size to a value != 0 which suggests they want it
	honored.



Modified:
   trunk/ChangeLog
   trunk/README
   trunk/gtk/gtkadjustment.c

Modified: trunk/README
==============================================================================
--- trunk/README	(original)
+++ trunk/README	Tue Aug  5 14:25:29 2008
@@ -42,6 +42,13 @@
   the GtkFileSystem interface is no longer available, nor the filechooser
   will load any GtkFileSystem implementation.
 
+* gtk_adjustment_set_value() now correctly clamps the passed value to
+  [lower...upper-page_size] instead of just to [lower...upper].
+  This has the potential to break some corner cases, however these
+  cases would set page_size to a value != 0 which suggests they want
+  it honored. All manual clamping in code calling set_value() can now
+  be safely removed.
+
 Release notes for 2.12
 ======================
 

Modified: trunk/gtk/gtkadjustment.c
==============================================================================
--- trunk/gtk/gtkadjustment.c	(original)
+++ trunk/gtk/gtkadjustment.c	Tue Aug  5 14:25:29 2008
@@ -354,7 +354,7 @@
 {
   g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
 
-  value = CLAMP (value, adjustment->lower, adjustment->upper);
+  value = CLAMP (value, adjustment->lower, adjustment->upper - adjustment->page_size);
 
   if (value != adjustment->value)
     {



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