// first vertically scroll to the new row to make it fully visible (or as visible as possible)
if(t->selectedRow<t->vscrollpos)
vscrollto(t,t->selectedRow);
else{
rc.row=t->selectedRow;
rc.column=t->selectedColumn;
// first assume entirely outside the client area
dovscroll=TRUE;
if(rowColumnToClientRect(t,rc,&r))
// partially outside the client area?
if(r.bottom<=client.bottom)// <= here since we are comparing bottoms (which are the first pixels outside the rectangle)
dovscroll=FALSE;
if(dovscroll)
vscrollto(t,t->selectedRow-t->vpagesize+1);// + 1 because apparently just t->selectedRow - t->vpagesize results in no scrolling (t->selectedRow - t->vpagesize == t->vscrollpos)...
}
// TODO horizontal scroll
// now redraw the old and new /rows/
// we do this after scrolling so the rectangles to be invalidated make sense