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:17:18 -0400
commitc365eb3b449f5c6e66639f1a8b2c72d9a8c5db08 (patch)
treee99d34d682827d8e56346e9aee1fd918e16a122b
parent5fe0cff359a9771843a9b30482eb84169d3a876a (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 cabeebb..4370372 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -1156,12 +1156,47 @@ evas_object_image_size_get(const Evas_Image *obj, int *w, int *h)
1156} 1156}
1157 1157
1158EOLIAN static void 1158EOLIAN static void
1159_evas_image_efl_gfx_view_size_get(Eo *eo_obj EINA_UNUSED, 1159_evas_image_efl_gfx_view_size_get(Eo *eo_obj,
1160 Evas_Image_Data *o, 1160 Evas_Image_Data *o,
1161 int *w, int *h) 1161 int *w, int *h)
1162{ 1162{
1163 if (w) *w = o->cur->image.w; 1163 int uvw, uvh;
1164 if (h) *h = o->cur->image.h; 1164 Evas_Object_Protected_Data *source = NULL;
1165 Evas_Object_Protected_Data *obj;
1166
1167 obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1168 if (o->cur->source)
1169 source = eo_data_scope_get(o->cur->source, EVAS_OBJECT_CLASS);
1170
1171 if (o->cur->scene)
1172 {
1173 uvw = obj->data_3d->w;
1174 uvh = obj->data_3d->h;
1175 }
1176 else if (!o->cur->source)
1177 {
1178 uvw = o->cur->image.w;
1179 uvh = o->cur->image.h;
1180 }
1181 else if (source->proxy->surface && !source->proxy->redraw)
1182 {
1183 uvw = source->proxy->w;
1184 uvh = source->proxy->h;
1185 }
1186 else if (source->type == o_type &&
1187 ((Evas_Image_Data *)eo_data_scope_get(o->cur->source, MY_CLASS))->engine_data)
1188 {
1189 uvw = source->cur->geometry.w;
1190 uvh = source->cur->geometry.h;
1191 }
1192 else
1193 {
1194 uvw = source->proxy->w;
1195 uvh = source->proxy->h;
1196 }
1197
1198 if (w) *w = uvw;
1199 if (h) *h = uvh;
1165} 1200}
1166 1201
1167EOLIAN static int 1202EOLIAN static int