ocarina: Don't scroll if (index < number of visible rows)
This prevents a possible slow down / infinite loop (I never actually let it finish) Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
ee2191fc4f
commit
3cbeb85828
|
@ -71,7 +71,11 @@ namespace ocarina
|
|||
height = area.height;
|
||||
gtk_tree_view_get_cell_area(GTK_TREE_VIEW(treeview), path, col, &area);
|
||||
n = height / area.height;
|
||||
n = index - (n / 2);
|
||||
|
||||
if (index < (n / 2))
|
||||
n = 0;
|
||||
else
|
||||
n = index - (n / 2);
|
||||
|
||||
for (unsigned int i = 0; i < n; i++)
|
||||
gtk_tree_path_next(path);
|
||||
|
|
Loading…
Reference in New Issue