it->x = cx;
it->y = cy;
evas_object_geometry_get(wsd->pan_obj, &ox, &oy, &vw, &vh);
+ if (getenv("GENGRID_REALIZE_POLICY_WITH_CANVAS_OUTPUT_SIZE"))
+ {
+ evas_output_viewport_get
+ (evas_object_evas_get(wsd->pan_obj), &cvx, &cvy, &cvw, &cvh);
+ if (ELM_RECTS_INTERSECT(cvx, cvy, cvw, cvh, ox, oy, vw, vh))
+ {
+ cvx = MAX(cvx, ox);
+ cvw = MIN(cvx + cvw, ox + vw) - cvx;
+ cvy = MAX(cvy, oy);
+ cvh = MIN(cvy + cvh, oy + vh) - cvy;
+ }
+ else
+ {
+ cvx = 0; cvy = 0; cvw = 0; cvh = 0;
+ }
+ }
+ else
+ {
+ cvx = ox; cvy = oy; cvw = vw; cvh = vh;
+ }
/* Preload rows/columns at each side of the Gengrid */
- cvx = ox - PRELOAD * wsd->item_width;
- cvy = oy - PRELOAD * wsd->item_height;
- cvw = vw + 2 * PRELOAD * wsd->item_width;
- cvh = vh + 2 * PRELOAD * wsd->item_height;
+ cvx = cvx - PRELOAD * wsd->item_width;
+ cvy = cvy - PRELOAD * wsd->item_height;
+ cvw = cvw + 2 * PRELOAD * wsd->item_width;
+ cvh = cvh + 2 * PRELOAD * wsd->item_height;
items_count = wsd->item_count -
eina_list_count(wsd->group_items) + wsd->items_lost;