if (in_overscroll)
{
- diff = point.y - last_overscroll.y;
+ if (horizontal)
+ diff = point.x - last_overscroll.x;
+ else
+ diff = point.y - last_overscroll.y;
if (diff < 0)
{
bounds = Bounds ();
bounds.InsetBy (1.0, 1.0);
value = overscroll_start_value;
- trough_size = BE_RECT_HEIGHT (bounds);
- trough_size -= BE_RECT_WIDTH (bounds) / 2;
+ trough_size = (horizontal
+ ? BE_RECT_WIDTH (bounds)
+ : BE_RECT_HEIGHT (bounds));
+ trough_size -= (horizontal
+ ? BE_RECT_HEIGHT (bounds)
+ : BE_RECT_WIDTH (bounds)) / 2;
if (info.double_arrows)
- trough_size -= BE_RECT_WIDTH (bounds) / 2;
+ trough_size -= (horizontal
+ ? BE_RECT_HEIGHT (bounds)
+ : BE_RECT_WIDTH (bounds)) / 2;
value += ((double) range / trough_size) * diff;
bar->page_size = size;
BView_scroll_bar_update (scroll_bar, lrint (size), BE_SB_MAX,
- ceil (value), bar->dragging, false);
+ ceil (value), bar->dragging ? -1 : 0, true);
}
static struct scroll_bar *