summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-05-27 22:11:56 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-05-27 22:16:22 -0400
commit29cf9abfc6c2bb7f38280011221445864cb19a9c (patch)
treea3f7180fab8045e3d8a942973bfcd517efaa58d5
parent85166a0c73d78e12a233f1bf290416734cb15753 (diff)
evas: make image_size_get() return the actual image size
proxy/3d/etc images would previously return 0x0, breaking size calcs @fix @jpeg
-rw-r--r--src/lib/evas/canvas/evas_object_image.c41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index b3d6fb6fc2..b3e067cf41 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -1158,12 +1158,47 @@ evas_object_image_size_get(const Evas_Image *obj, int *w, int *h)
1158} 1158}
1159 1159
1160EOLIAN static void 1160EOLIAN static void
1161_evas_image_efl_gfx_view_size_get(Eo *eo_obj EINA_UNUSED, 1161_evas_image_efl_gfx_view_size_get(Eo *eo_obj,
1162 Evas_Image_Data *o, 1162 Evas_Image_Data *o,
1163 int *w, int *h) 1163 int *w, int *h)
1164{ 1164{
1165 if (w) *w = o->cur->image.w; 1165 int uvw, uvh;
1166 if (h) *h = o->cur->image.h; 1166 Evas_Object_Protected_Data *source = NULL;
1167 Evas_Object_Protected_Data *obj;
1168
1169 obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1170 if (o->cur->source)
1171 source = eo_data_scope_get(o->cur->source, EVAS_OBJECT_CLASS);
1172
1173 if (o->cur->scene)
1174 {
1175 uvw = obj->data_3d->w;
1176 uvh = obj->data_3d->h;
1177 }
1178 else if (!o->cur->source)
1179 {
1180 uvw = o->cur->image.w;
1181 uvh = o->cur->image.h;
1182 }
1183 else if (source->proxy->surface && !source->proxy->redraw)
1184 {
1185 uvw = source->proxy->w;
1186 uvh = source->proxy->h;
1187 }
1188 else if (source->type == o_type &&
1189 ((Evas_Image_Data *)eo_data_scope_get(o->cur->source, MY_CLASS))->engine_data)
1190 {
1191 uvw = source->cur->geometry.w;
1192 uvh = source->cur->geometry.h;
1193 }
1194 else
1195 {
1196 uvw = source->proxy->w;
1197 uvh = source->proxy->h;
1198 }
1199
1200 if (w) *w = uvw;
1201 if (h) *h = uvh;
1167} 1202}
1168 1203
1169EOLIAN static int 1204EOLIAN static int