CComponentsForm: fix unnecessary try for scroll

This avoids unnecessary flicker effects, because no paint is required,
if page count = 1 and also ensures, that this page is defined as current page.
This commit is contained in:
2014-10-05 17:20:05 +02:00
parent 09851f3b9f
commit 23c708b787

View File

@@ -622,9 +622,14 @@ CComponentsItem* CComponentsForm::getSelectedItemObject()
void CComponentsForm::ScrollPage(int direction, bool do_paint) void CComponentsForm::ScrollPage(int direction, bool do_paint)
{ {
if (getPageCount() == 1){
cur_page = 0;
return;
}
OnBeforeScrollPage(); OnBeforeScrollPage();
int target_page_id = (int)getPageCount() - 1; int target_page_id = (int)page_count - 1;
int target_page = (int)cur_page; int target_page = (int)cur_page;
if (direction == SCROLL_P_DOWN) if (direction == SCROLL_P_DOWN)