Merge pull request #294 from pinumbernumber/master

Do not scroll RGUI if all items are visible at once
This commit is contained in:
Hans-Kristian Arntzen 2013-08-30 04:48:21 -07:00
commit 0720eedd2a

View File

@ -418,6 +418,10 @@ static void render_text(rgui_handle_t *rgui)
rgui->selection_ptr - TERM_HEIGHT / 2 : 0;
size_t end = rgui->selection_ptr + TERM_HEIGHT <= rgui->selection_buf->size ?
rgui->selection_ptr + TERM_HEIGHT : rgui->selection_buf->size;
// Do not scroll if all items are visible.
if (rgui->selection_buf->size <= TERM_HEIGHT)
begin = 0;
if (end - begin > TERM_HEIGHT)
end = begin + TERM_HEIGHT;