image: use eo_isa for checking object types instead of string comparison

This commit is contained in:
Amitesh Singh 2015-10-22 22:14:40 +05:30
parent 894faaadac
commit dcc066569f
1 changed files with 2 additions and 10 deletions

View File

@ -122,17 +122,13 @@ static void
_elm_image_internal_sizing_eval(Evas_Object *obj, Elm_Image_Data *sd) _elm_image_internal_sizing_eval(Evas_Object *obj, Elm_Image_Data *sd)
{ {
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h;
const char *type;
if (!sd->img) return; if (!sd->img) return;
w = sd->img_w; w = sd->img_w;
h = sd->img_h; h = sd->img_h;
type = evas_object_type_get(sd->img); if (eo_isa(sd->img, EDJE_OBJECT_CLASS))
if (!type) return;
if (!strcmp(type, "edje"))
{ {
x = sd->img_x; x = sd->img_x;
y = sd->img_y; y = sd->img_y;
@ -1268,15 +1264,11 @@ _elm_image_object_size_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, int *w, int
{ {
int tw, th; int tw, th;
int cw = 0, ch = 0; int cw = 0, ch = 0;
const char *type;
if (w) *w = 0; if (w) *w = 0;
if (h) *h = 0; if (h) *h = 0;
type = evas_object_type_get(sd->img); if (eo_isa(sd->img, EDJE_OBJECT_CLASS))
if (!type) return;
if (!strcmp(type, "edje"))
edje_object_size_min_get(sd->img, &tw, &th); edje_object_size_min_get(sd->img, &tw, &th);
else else
evas_object_image_size_get(sd->img, &tw, &th); evas_object_image_size_get(sd->img, &tw, &th);