… | |
… | |
153 | if (!scrollbar_visible ()) |
153 | if (!scrollbar_visible ()) |
154 | return 0; |
154 | return 0; |
155 | |
155 | |
156 | if (update) |
156 | if (update) |
157 | { |
157 | { |
158 | top = nscrolled - view_start; |
158 | top = nsaved - view_start; |
159 | bot = top + (nrow - 1); |
159 | bot = top + (nrow - 1); |
160 | len = max (nscrolled + (nrow - 1), 1); |
160 | len = max (nsaved + (nrow - 1), 1); |
161 | adj = (((bot - top) * scrollbar_size ()) % len) > 0 ? 1 : 0; |
161 | adj = (((bot - top) * scrollbar_size ()) % len) > 0 ? 1 : 0; |
162 | |
162 | |
163 | scrollBar.top = (scrollBar.beg + (top * scrollbar_size ()) / len); |
163 | scrollBar.top = (scrollBar.beg + (top * scrollbar_size ()) / len); |
164 | scrollbar_len = ((bot - top) * scrollbar_size ()) / len + |
164 | scrollbar_len = ((bot - top) * scrollbar_size ()) / len + |
165 | scrollbar_minheight () + adj; |
165 | scrollbar_minheight () + adj; |
… | |
… | |
230 | if (style != R_SB_NEXT) /* dishonour request - for now */ |
230 | if (style != R_SB_NEXT) /* dishonour request - for now */ |
231 | if (thickness && (i = atoi (thickness)) >= SB_WIDTH_MINIMUM) |
231 | if (thickness && (i = atoi (thickness)) >= SB_WIDTH_MINIMUM) |
232 | width = min (i, SB_WIDTH_MAXIMUM); |
232 | width = min (i, SB_WIDTH_MAXIMUM); |
233 | |
233 | |
234 | # if defined(RXVT_SCROLLBAR) |
234 | # if defined(RXVT_SCROLLBAR) |
235 | if (! (options & Opt_scrollBar_floating) && style == R_SB_RXVT) |
235 | if (! OPTION (Opt_scrollBar_floating) && style == R_SB_RXVT) |
236 | sb_shadow = SHADOW; |
236 | sb_shadow = MENU_SHADOW; |
237 | # endif |
237 | # endif |
238 | |
238 | |
239 | scrollBar.style = style; |
239 | scrollBar.style = style; |
240 | scrollBar.width = width; |
240 | scrollBar.width = width; |
241 | |
241 | |