Fix seg when window is resized too small.
SVN revision: 42968
This commit is contained in:
parent
ded2e589e6
commit
9c7fb20968
|
@ -187,6 +187,8 @@ void ephoto_table_viewport_set(Evas_Object *obj, int w, int h)
|
||||||
sd->rows = sd->pageh/(sd->padh+sd->itemh);
|
sd->rows = sd->pageh/(sd->padh+sd->itemh);
|
||||||
sd->columns = sd->pagew/(sd->padw+sd->itemw);
|
sd->columns = sd->pagew/(sd->padw+sd->itemw);
|
||||||
sd->items_per_page = sd->rows*sd->columns;
|
sd->items_per_page = sd->rows*sd->columns;
|
||||||
|
if (sd->items_per_page == 0)
|
||||||
|
return;
|
||||||
pages = eina_list_count(sd->images)/sd->items_per_page;
|
pages = eina_list_count(sd->images)/sd->items_per_page;
|
||||||
remain = eina_list_count(sd->images)%sd->items_per_page;
|
remain = eina_list_count(sd->images)%sd->items_per_page;
|
||||||
if (remain > 0)
|
if (remain > 0)
|
||||||
|
@ -213,6 +215,9 @@ void ephoto_table_pack(Evas_Object *obj, char *image)
|
||||||
if (!sd)
|
if (!sd)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (sd->items_per_page == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
sd->images = eina_list_append(sd->images, strdup(image));
|
sd->images = eina_list_append(sd->images, strdup(image));
|
||||||
|
|
||||||
if (sd->cur_row > sd->rows)
|
if (sd->cur_row > sd->rows)
|
||||||
|
@ -307,6 +312,9 @@ static void _table_smart_change_page(Smart_Data *sd, int direction)
|
||||||
int w, h, j, vis, head, back, pages, remain;
|
int w, h, j, vis, head, back, pages, remain;
|
||||||
Eina_List *iterator, *iteratorb;
|
Eina_List *iterator, *iteratorb;
|
||||||
|
|
||||||
|
if (sd->items_per_page == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
pages = eina_list_count(sd->images)/sd->items_per_page;
|
pages = eina_list_count(sd->images)/sd->items_per_page;
|
||||||
remain = eina_list_count(sd->images)%sd->items_per_page;
|
remain = eina_list_count(sd->images)%sd->items_per_page;
|
||||||
if (remain > 0)
|
if (remain > 0)
|
||||||
|
@ -501,6 +509,9 @@ static void _table_smart_reconfigure(Smart_Data *sd)
|
||||||
int w, h, j;
|
int w, h, j;
|
||||||
Eina_List *iterator, *iteratorb;
|
Eina_List *iterator, *iteratorb;
|
||||||
|
|
||||||
|
if (sd->items_per_page == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!sd->images)
|
if (!sd->images)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue