From: hermet Date: Thu, 3 Mar 2011 13:01:39 +0000 (+0000) Subject: elementary/gengrid - fixed a bug by jh0506.yun@samsung.com X-Git-Tag: REL_F_I9500_20120323_1~17^2~3089 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd3235949e92997e9ff8144143a8219812328ee4;p=framework%2Fuifw%2Felementary.git elementary/gengrid - fixed a bug by jh0506.yun@samsung.com Hello. I attached the modified patch about calc_job problem. When I tested gengrid, sometimes gengrid renderd two times in different shape in a moment. So I checked gengrid code, I found cause in calc_job function. calc_job added to ecore job after elm_gengrid_item_size_set and elm_gengrid_item_append(,prepend,insert_before,insert_after) and etc. Sometimes pan_smart's cvw and cvh is 0 at this time. I think, No need to calc_job when pan_smart's cvw and cvh is 0. Please check about this patch. Thanks. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@57491 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c index 0a65596..5227363 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -1281,36 +1281,39 @@ _calc_job(void *data) int count; evas_object_geometry_get(wd->pan_smart, NULL, NULL, &cvw, &cvh); - if ((wd->horizontal) && (wd->item_height > 0)) - nmax = cvh / wd->item_height; - else if (wd->item_width > 0) - nmax = cvw / wd->item_width; + if ((cvw != 0) || (cvh != 0)) + { + if ((wd->horizontal) && (wd->item_height > 0)) + nmax = cvh / wd->item_height; + else if (wd->item_width > 0) + nmax = cvw / wd->item_width; - if (nmax < 1) - nmax = 1; + if (nmax < 1) + nmax = 1; - count = wd->count; - if (wd->horizontal) - { - minw = ceil(count / (float)nmax) * wd->item_width; - minh = nmax * wd->item_height; - } - else - { - minw = nmax * wd->item_width; - minh = ceil(count / (float)nmax) * wd->item_height; - } + count = wd->count; + if (wd->horizontal) + { + minw = ceil(count / (float)nmax) * wd->item_width; + minh = nmax * wd->item_height; + } + else + { + minw = nmax * wd->item_width; + minh = ceil(count / (float)nmax) * wd->item_height; + } - if ((minw != wd->minw) || (minh != wd->minh)) - { - wd->minh = minh; - wd->minw = minw; - evas_object_smart_callback_call(wd->pan_smart, "changed", NULL); - } + if ((minw != wd->minw) || (minh != wd->minh)) + { + wd->minh = minh; + wd->minw = minw; + evas_object_smart_callback_call(wd->pan_smart, "changed", NULL); + } - wd->nmax = nmax; - wd->calc_job = NULL; - evas_object_smart_changed(wd->pan_smart); + wd->nmax = nmax; + wd->calc_job = NULL; + evas_object_smart_changed(wd->pan_smart); + } } static void