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.57 by ayin, Mon Feb 18 11:41:39 2008 UTC vs.
Revision 1.58 by ayin, Mon Feb 18 11:42:23 2008 UTC

104 104
105/* 105/*
106 * Update current scrollbar view w.r.t. slider heights, etc. 106 * Update current scrollbar view w.r.t. slider heights, etc.
107 */ 107 */
108int 108int
109rxvt_term::scrollbar_show (int update) 109rxvt_term::scrollbar_show (int refresh)
110{ 110{
111 int ret = 0; 111 int ret = 0;
112 112
113 if (!scrollBar.state) 113 if (!scrollBar.state)
114 return 0; 114 return 0;
115 115
116 if (update) 116 if (refresh)
117 { 117 {
118 int top = view_start - top_row; 118 int sb_top = view_start - top_row;
119 int bot = top + (nrow - 1); 119 int sb_bot = sb_top + (nrow - 1);
120 int len = max (nrow - 1 - top_row, 1); 120 int sb_len = max (nrow - 1 - top_row, 1);
121 int size = (bot - top) * scrollBar.size (); 121 int sb_size = (sb_bot - sb_top) * scrollBar.size ();
122 122
123 scrollBar.top = (scrollBar.beg + (top * scrollBar.size ()) / len); 123 scrollBar.top = (scrollBar.beg + (sb_top * scrollBar.size ()) / sb_len);
124 scrollBar.len = size / len + scrollBar.min_height () + (size % len > 0); 124 scrollBar.len = sb_size / sb_len + scrollBar.min_height () + (sb_size % sb_len > 0);
125 scrollBar.bot = (scrollBar.top + scrollBar.len); 125 scrollBar.bot = (scrollBar.top + scrollBar.len);
126 /* no change */ 126 /* no change */
127 if (scrollBar.top == scrollBar.last_top 127 if (scrollBar.top == scrollBar.last_top
128 && scrollBar.bot == scrollBar.last_bot 128 && scrollBar.bot == scrollBar.last_bot
129 && (scrollBar.state == scrollBar.last_state 129 && (scrollBar.state == scrollBar.last_state
130 || !(scrollBar.state == STATE_UP || scrollBar.state == STATE_DOWN))) 130 || !(scrollBar.state == STATE_UP || scrollBar.state == STATE_DOWN)))
131 return 0; 131 return 0;
132 } 132 }
133 133
134 ret = (this->*scrollBar.update) (update, scrollBar.last_top, scrollBar.last_bot, scrollBar.len); 134 ret = (this->*scrollBar.update) (refresh, scrollBar.last_top, scrollBar.last_bot, scrollBar.len);
135 135
136 scrollBar.last_top = scrollBar.top; 136 scrollBar.last_top = scrollBar.top;
137 scrollBar.last_bot = scrollBar.bot; 137 scrollBar.last_bot = scrollBar.bot;
138 scrollBar.last_state = scrollBar.state; 138 scrollBar.last_state = scrollBar.state;
139 139

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines