Commit d7117b69 authored by dscho's avatar dscho

index was shadowed

parent ff9fbd97
...@@ -66,17 +66,17 @@ static void selPaintLine(rfbSelectData* m,int line,Bool invert) ...@@ -66,17 +66,17 @@ static void selPaintLine(rfbSelectData* m,int line,Bool invert)
invert?m->backColour:m->colour); invert?m->backColour:m->colour);
} }
static void selSelect(rfbSelectData* m,int index) static void selSelect(rfbSelectData* m,int _index)
{ {
int delta; int delta;
if(index==m->selected || index<0 || index>=m->listSize) if(_index==m->selected || _index<0 || _index>=m->listSize)
return; return;
if(m->selected>=0) if(m->selected>=0)
selPaintLine(m,m->selected-m->displayStart,FALSE); selPaintLine(m,m->selected-m->displayStart,FALSE);
if(index<m->displayStart || index>=m->displayStart+m->pageH) { if(_index<m->displayStart || _index>=m->displayStart+m->pageH) {
/* targetLine is the screen line in which the selected line will /* targetLine is the screen line in which the selected line will
be displayed. be displayed.
targetLine = m->pageH/2 doesn't look so nice */ targetLine = m->pageH/2 doesn't look so nice */
...@@ -84,11 +84,11 @@ static void selSelect(rfbSelectData* m,int index) ...@@ -84,11 +84,11 @@ static void selSelect(rfbSelectData* m,int index)
int lineStart,lineEnd; int lineStart,lineEnd;
/* scroll */ /* scroll */
if(index<targetLine) if(_index<targetLine)
targetLine = index; targetLine = _index;
else if(index+m->pageH-targetLine>=m->listSize) else if(_index+m->pageH-targetLine>=m->listSize)
targetLine = index+m->pageH-m->listSize; targetLine = _index+m->pageH-m->listSize;
delta = index-(m->displayStart+targetLine); delta = _index-(m->displayStart+targetLine);
if(delta>-m->pageH && delta<m->pageH) { if(delta>-m->pageH && delta<m->pageH) {
if(delta>0) { if(delta>0) {
...@@ -109,15 +109,15 @@ static void selSelect(rfbSelectData* m,int index) ...@@ -109,15 +109,15 @@ static void selSelect(rfbSelectData* m,int index)
} }
m->displayStart += delta; m->displayStart += delta;
for(delta=lineStart;delta<lineEnd;delta++) for(delta=lineStart;delta<lineEnd;delta++)
if(delta!=index) if(delta!=_index)
selPaintLine(m,delta,FALSE); selPaintLine(m,delta,FALSE);
} }
m->selected = index; m->selected = _index;
selPaintLine(m,m->selected-m->displayStart,TRUE); selPaintLine(m,m->selected-m->displayStart,TRUE);
if(m->selChangedHook) if(m->selChangedHook)
m->selChangedHook(index); m->selChangedHook(_index);
/* todo: scrollbars */ /* todo: scrollbars */
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment