diff options
-rw-r--r-- | gui.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -145,14 +145,12 @@ void gui_scrollable( nx = cs[0] - (r.w - size); ny = cs[1] - (r.h - size); } - if (nx > 0) { - state->x = clamp(state->x, 0, nx); + state->x = clamp(state->x, 0, maxi(0, nx)); + state->y = clamp(state->y, 0, maxi(0, ny)); + if (nx > 0) gui_scrollbar(g, state, srx, nx, 1); - } - if (ny > 0) { - state->y = clamp(state->y, 0, ny); + if (ny > 0) gui_scrollbar(g, state, sry, ny, 0); - } } void gui_scrollbar( |