From 7eca1cc39ac0d82f9e8f1db04114a4e0302b545c Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Thu, 29 Nov 2012 06:51:30 +0000 Subject: [PATCH] elementary/mapbuf - fix the mapbuf to update it's contents correctly even if they go outside of the buffer SVN revision: 79813 --- legacy/elementary/ChangeLog | 6 +++ legacy/elementary/NEWS | 1 + legacy/elementary/src/lib/elm_mapbuf.c | 38 ++++++++++++++----- legacy/elementary/src/lib/elm_widget_mapbuf.h | 1 + 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index a2085f4454..f0c228f7b9 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -715,4 +715,10 @@ * Free the text parts of the naviframe item when item is deleted. 2012-11-26 Daniel Zaoui and Yaakov Goldberg + * Porting of Elementary to Eo + +2012-11-29 ChunEon Park (Hermet) + + * Fix the mapbuf to update it's contents correctly, even if they go + outside of the buffer diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index ecd4e9a486..df04a3afee 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -65,6 +65,7 @@ Fixes: * Fix the naviframe to clear the title contents when it's item is deleted. * Fix entry to enable have_selection only when a text is actually selected. * Fix the naviframe to clear the text parts when it's item is deleted. + * Fix the mapbuf to update it's content correcltly evenif they go outside of the buffer. Removals: diff --git a/legacy/elementary/src/lib/elm_mapbuf.c b/legacy/elementary/src/lib/elm_mapbuf.c index 95b63f1048..0c13433370 100644 --- a/legacy/elementary/src/lib/elm_mapbuf.c +++ b/legacy/elementary/src/lib/elm_mapbuf.c @@ -113,20 +113,40 @@ _configure(Evas_Object *obj) ELM_MAPBUF_DATA_GET(obj, sd); Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS); - if (sd->content) - { - Evas_Coord x, y, w, h, x2, y2; + if (!sd->content) return; + Evas_Coord x, y, w, h, x2, y2, w2, h2; + evas_object_geometry_get(wd->resize_obj, &x, &y, &w, &h); + evas_object_geometry_get(sd->content, &x2, &y2, &w2, &h2); - evas_object_geometry_get - (wd->resize_obj, &x, &y, &w, &h); - evas_object_geometry_get(sd->content, &x2, &y2, NULL, NULL); - if ((x != x2) || (y != y2)) + if ((x != x2) || (y != y2)) + { + if (!sd->enabled) + evas_object_move(sd->content, x, y); + else { - if (!sd->enabled) + //Let give the chance to update the content whenever content is + //coming inside buffer from the outside. It means the content may + //have been changed when it is on the outside, but the surface + //may not be updated because contents would be outside of the + //viewport. + Evas_Coord output_w, output_h; + Evas *e = evas_object_evas_get(obj); + evas_output_size_get(e, &output_w, &output_h); + Eina_Bool update = EINA_FALSE; + + if ((x2 >= output_w) || (y2 >= output_h) || + ((x2 + w2) <= 0) || ((y2 + h2) <= 0)) + sd->outside = EINA_TRUE; + else if (sd->outside) + { + sd->outside = EINA_FALSE; + update = EINA_TRUE; + } + + if (update) evas_object_move(sd->content, x, y); else { - Evas *e = evas_object_evas_get(obj); evas_smart_objects_calculate(e); evas_nochange_push(e); evas_object_move(sd->content, x, y); diff --git a/legacy/elementary/src/lib/elm_widget_mapbuf.h b/legacy/elementary/src/lib/elm_widget_mapbuf.h index 9e00d876c4..fdc7ae88b9 100644 --- a/legacy/elementary/src/lib/elm_widget_mapbuf.h +++ b/legacy/elementary/src/lib/elm_widget_mapbuf.h @@ -25,6 +25,7 @@ struct _Elm_Mapbuf_Smart_Data Eina_Bool enabled : 1; Eina_Bool smooth : 1; Eina_Bool alpha : 1; + Eina_Bool outside : 1; }; /**