Re: bug in gtk_adjustment_clamp_page()?
- From: Florian Müllner <fmuellner gnome org>
- To: jcupitt gmail com
- Cc: gtk-devel-list <gtk-devel-list gnome org>
- Subject: Re: bug in gtk_adjustment_clamp_page()?
- Date: Thu, 26 Nov 2015 18:31:00 +0100
On Thu, Nov 26, 2015 at 4:24 PM, <jcupitt gmail com> 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.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]