Less awkward fix for werase() issue in ScrollAdapterBase.

This commit is contained in:
casey langen 2020-04-10 21:49:57 -07:00
parent 23b274bce9
commit 5f40690efb

View File

@ -112,16 +112,12 @@ size_t ScrollAdapterBase::GetVisibleItems(
void ScrollAdapterBase::DrawPage(ScrollableWindow* scrollable, size_t index, ScrollPosition& result) {
WINDOW* window = scrollable->GetContent();
if (!window) {
if (!scrollable->IsVisible() || !window || this->height == 0 || this->width == 0 || this->GetEntryCount() == 0) {
return;
}
werase(window);
if (!scrollable->IsVisible() || !window || this->height == 0 || this->width == 0 || this->GetEntryCount() == 0) {
return;
}
if (index >= GetEntryCount()) {
index = GetEntryCount() - 1;
}