Web lists-archives.com

Re: bug in gtk_adjustment_clamp_page()?

On Thu, Nov 26, 2015 at 4:24 PM,  <jcupitt@xxxxxxxxx> wrote:
> These lines:
>   https://git.gnome.org/browse/gtk+/tree/gtk/gtkadjustment.c#n932
> Clamp the value of an adjustment so it lies between lower and upper.

No. From the documentation a couple of lines above:
"Updates the #GtkAdjustment:value property to ensure that the range
between @lower and @upper is in the current page (i.e. between
#GtkAdjustment:value and #GtkAdjustment:value + #GtkAdjustment:page-size)."

In other words:
:value <= @lower <= @upper <= :value + :page-size
(if @upper - @lower <= :page-size, otherwise @lower "wins")

So the comparison operators are correct for the documented behavior.
gtk-devel-list mailing list