]> Pileus Git - ~andy/gtk/commitdiff
clamp the value to [lower...upper-page_size] instead of only
authorMichael Natterer <mitch@imendio.com>
Tue, 5 Aug 2008 14:25:29 +0000 (14:25 +0000)
committerMichael Natterer <mitch@src.gnome.org>
Tue, 5 Aug 2008 14:25:29 +0000 (14:25 +0000)
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.

svn path=/trunk/; revision=21012

ChangeLog
README
gtk/gtkadjustment.c

index ca840dcfae3e94f49bc0b834c66f6647af4bbfb1..f342f8303b8c66183c45c3b6b87f6149d45e0256 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+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.
+
 2008-08-05  Michael Natterer  <mitch@imendio.com>
 
        * tests/testiconview.c: don't use the deprecated
diff --git a/README b/README
index 5f43cc1b50d62b1787c99e140037131288acb99f..ccde59a76cf97866f567ec804265e43def349d73 100644 (file)
--- a/README
+++ b/README
@@ -42,6 +42,13 @@ Release notes for 2.14
   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
 ======================
 
index 1fcbcba180eb8426322872b90d441586f72c830f..eb86a663a8e68a7710339e5f28ac98031766eed1 100644 (file)
@@ -354,7 +354,7 @@ gtk_adjustment_set_value (GtkAdjustment *adjustment,
 {
   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)
     {