summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-08-23 14:24:11 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-08-25 14:48:12 -0400
commit77455208525dfc1ecbee9d3eb65459f514ee0b1a (patch)
tree77e2c402e4f1ac32e6eb9e8dc65bee643735a6db
parent8dbea4a709fccbb8a79ac92c1c796289964c5e35 (diff)
efl_ui_image: maintain geometry for prev image while preloading new image
if prev_img exists then it is visible, so continue maintaining its geometry until it is deleted fix T5936 @fix
-rw-r--r--src/lib/elementary/efl_ui_image.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index e123e9c679..c62ae92f3a 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -151,14 +151,13 @@ _img_new(Evas_Object *obj)
151} 151}
152 152
153static void 153static void
154_efl_ui_image_internal_sizing_eval(Evas_Object *obj, Efl_Ui_Image_Data *sd) 154_image_sizing_eval(Efl_Ui_Image_Data *sd, Evas_Object *img)
155{ 155{
156 if (!sd->img) return;
157 156
158 if (efl_isa(sd->img, EDJE_OBJECT_CLASS)) 157 if (efl_isa(img, EDJE_OBJECT_CLASS))
159 { 158 {
160 evas_object_move(sd->img, sd->img_x, sd->img_y); 159 evas_object_move(img, sd->img_x, sd->img_y);
161 evas_object_resize(sd->img, sd->img_w, sd->img_h); 160 evas_object_resize(img, sd->img_w, sd->img_h);
162 161
163 evas_object_move(sd->hit_rect, sd->img_x, sd->img_y); 162 evas_object_move(sd->hit_rect, sd->img_x, sd->img_y);
164 evas_object_resize(sd->hit_rect, sd->img_w, sd->img_h); 163 evas_object_resize(sd->hit_rect, sd->img_w, sd->img_h);
@@ -170,7 +169,7 @@ _efl_ui_image_internal_sizing_eval(Evas_Object *obj, Efl_Ui_Image_Data *sd)
170 int iw = 0, ih = 0, offset_x = 0, offset_y = 0; 169 int iw = 0, ih = 0, offset_x = 0, offset_y = 0;
171 170
172 //1. Get the original image size (iw x ih) 171 //1. Get the original image size (iw x ih)
173 evas_object_image_size_get(sd->img, &iw, &ih); 172 evas_object_image_size_get(img, &iw, &ih);
174 173
175 iw = ((double)iw) * sd->scale; 174 iw = ((double)iw) * sd->scale;
176 ih = ((double)ih) * sd->scale; 175 ih = ((double)ih) * sd->scale;
@@ -226,14 +225,14 @@ _efl_ui_image_internal_sizing_eval(Evas_Object *obj, Efl_Ui_Image_Data *sd)
226 } 225 }
227 226
228 //3. Calculate offset according to align value 227 //3. Calculate offset according to align value
229 if (!elm_widget_is_legacy(obj)) 228 if (!elm_widget_is_legacy(sd->self))
230 { 229 {
231 offset_x = ((sd->img_w - w) * sd->align_x); 230 offset_x = ((sd->img_w - w) * sd->align_x);
232 offset_y = ((sd->img_h - h) * sd->align_y); 231 offset_y = ((sd->img_h - h) * sd->align_y);
233 } 232 }
234 else 233 else
235 { 234 {
236 evas_object_size_hint_align_get(obj, &alignh, &alignv); 235 evas_object_size_hint_align_get(sd->self, &alignh, &alignv);
237 if (EINA_DBL_EQ(alignh, EVAS_HINT_FILL)) alignh = 0.5; 236 if (EINA_DBL_EQ(alignh, EVAS_HINT_FILL)) alignh = 0.5;
238 if (EINA_DBL_EQ(alignv, EVAS_HINT_FILL)) alignv = 0.5; 237 if (EINA_DBL_EQ(alignv, EVAS_HINT_FILL)) alignv = 0.5;
239 238
@@ -248,7 +247,7 @@ _efl_ui_image_internal_sizing_eval(Evas_Object *obj, Efl_Ui_Image_Data *sd)
248 if (offset_x >= 0) offset_x = 0; 247 if (offset_x >= 0) offset_x = 0;
249 if (offset_y >= 0) offset_y = 0; 248 if (offset_y >= 0) offset_y = 0;
250 249
251 evas_object_image_fill_set(sd->img, offset_x, offset_y, w, h); 250 evas_object_image_fill_set(img, offset_x, offset_y, w, h);
252 251
253 if (offset_x < 0) 252 if (offset_x < 0)
254 { 253 {
@@ -261,14 +260,22 @@ _efl_ui_image_internal_sizing_eval(Evas_Object *obj, Efl_Ui_Image_Data *sd)
261 h = sd->img_h; 260 h = sd->img_h;
262 } 261 }
263 262
264 evas_object_move(sd->img, x, y); 263 evas_object_move(img, x, y);
265 evas_object_resize(sd->img, w, h); 264 evas_object_resize(img, w, h);
266 265
267 evas_object_move(sd->hit_rect, x, y); 266 evas_object_move(sd->hit_rect, x, y);
268 evas_object_resize(sd->hit_rect, w, h); 267 evas_object_resize(sd->hit_rect, w, h);
269 } 268 }
270} 269}
271 270
271static void
272_efl_ui_image_internal_sizing_eval(Evas_Object *obj EINA_UNUSED, Efl_Ui_Image_Data *sd)
273{
274 if (!sd->img) return;
275 _image_sizing_eval(sd, sd->img);
276 if (sd->prev_img) _image_sizing_eval(sd, sd->prev_img);
277}
278
272static inline void 279static inline void
273_async_open_data_free(Async_Open_Data *data) 280_async_open_data_free(Async_Open_Data *data)
274{ 281{