ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/scrollbar.C
(Generate patch)

Comparing rxvt-unicode/src/scrollbar.C (file contents):
Revision 1.53 by ayin, Sun Feb 17 12:11:56 2008 UTC vs.
Revision 1.54 by ayin, Sun Feb 17 12:21:45 2008 UTC

139 */ 139 */
140int 140int
141rxvt_term::scrollbar_show (int update) 141rxvt_term::scrollbar_show (int update)
142{ 142{
143 int ret = 0; 143 int ret = 0;
144 int top, bot, len, adj;
145 144
146 if (!scrollBar.state) 145 if (!scrollBar.state)
147 return 0; 146 return 0;
148 147
149 if (update) 148 if (update)
150 { 149 {
151 top = view_start - top_row; 150 int top = view_start - top_row;
152 bot = top + (nrow - 1); 151 int bot = top + (nrow - 1);
153 len = max (nrow - 1 - top_row, 1); 152 int len = max (nrow - 1 - top_row, 1);
154 adj = (((bot - top) * scrollBar.size ()) % len) > 0 ? 1 : 0; 153 int adj = (((bot - top) * scrollBar.size ()) % len) > 0 ? 1 : 0;
155 154
156 scrollBar.top = (scrollBar.beg + (top * scrollBar.size ()) / len); 155 scrollBar.top = (scrollBar.beg + (top * scrollBar.size ()) / len);
157 scrollBar.len = ((bot - top) * scrollBar.size ()) / len + 156 scrollBar.len = ((bot - top) * scrollBar.size ()) / len +
158 scrollBar.min_height () + adj; 157 scrollBar.min_height () + adj;
159 scrollBar.bot = (scrollBar.top + scrollBar.len); 158 scrollBar.bot = (scrollBar.top + scrollBar.len);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines