Efl.Image: Fix documentation for ratio + implement in evas image

This commit is contained in:
Jean-Philippe Andre 2016-03-02 19:39:41 +09:00
parent fd2c4b4a26
commit e3de15d726
3 changed files with 11 additions and 2 deletions

View File

@ -34,11 +34,12 @@ interface Efl.Image {
}
}
@property ratio {
[[The native width/height ratio of the image.]]
get {
[[The native ration of the image object]]
[[Returns 1.0 if not applicable (eg. height = 0).]]
}
values {
ratio: double; [[The image's ratio]]
ratio: double; [[The image's ratio.]]
}
}
}

View File

@ -662,6 +662,7 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Animated, Efl.Gfx.
Efl.Image.load_size.get;
Efl.Image.smooth_scale.set;
Efl.Image.smooth_scale.get;
Efl.Image.ratio.get;
Efl.Gfx.Fill.fill.set;
Efl.Gfx.Fill.fill.get;
Efl.Gfx.Fill.filled.get;

View File

@ -1534,6 +1534,13 @@ _evas_image_efl_image_smooth_scale_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *
return o->cur->smooth_scale;
}
EOLIAN static double
_evas_image_efl_image_ratio_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
if (!o->cur->image.h) return 1.0;
return (double) o->cur->image.w / (double) o->cur->image.h;
}
/* deprecated */
EAPI void
evas_object_image_reload(Eo *eo_obj)