diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-09-19 12:32:52 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-09-19 12:32:52 +0100 |
commit | 6a74106d36059d27ad7150e0ad2c56d0ead80990 (patch) | |
tree | ebe6fe247161116b0a7994a67a31ee77c0e6936a | |
parent | f95b9d2eb3c9d10003f64db2af6b932c17d043e1 (diff) | |
download | netsurf-6a74106d36059d27ad7150e0ad2c56d0ead80990.tar.gz netsurf-6a74106d36059d27ad7150e0ad2c56d0ead80990.tar.bz2 |
Make code more readable.
-rw-r--r-- | desktop/scrollbar.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/desktop/scrollbar.c b/desktop/scrollbar.c index dadb82801..3d21aae02 100644 --- a/desktop/scrollbar.c +++ b/desktop/scrollbar.c @@ -524,9 +524,11 @@ void scrollbar_set_extents(struct scrollbar *s, int length, s->full_size = s->visible_size; /* Update scroll offset (scaled in proportion with change in excess) */ - s->offset = (cur_excess < 1) ? 0 : - ((s->full_size - s->visible_size) * s->offset / - cur_excess); + if (cur_excess <= 0) { + s->offset = 0; + } else { + s->offset = (full_size - visible_size) * s->offset / cur_excess; + } well_length = s->length - 2 * SCROLLBAR_WIDTH; |