diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2016-03-02 19:39:41 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2016-03-15 11:11:59 +0900 |
commit | e3de15d72642a61f57dda280befe458cb546c527 (patch) | |
tree | 15ed00b7385b4801e220de964873ad3681c21d55 | |
parent | fd2c4b4a268b59c2d92dc3d13ada83f56e011861 (diff) | |
download | efl-e3de15d72642a61f57dda280befe458cb546c527.tar.gz |
Efl.Image: Fix documentation for ratio + implement in evas image
-rw-r--r-- | src/lib/efl/interfaces/efl_image.eo | 5 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_image.eo | 1 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_image.c | 7 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/efl/interfaces/efl_image.eo b/src/lib/efl/interfaces/efl_image.eo index 3b0efbf411..2d5c01cc99 100644 --- a/src/lib/efl/interfaces/efl_image.eo +++ b/src/lib/efl/interfaces/efl_image.eo @@ -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.]] } } } diff --git a/src/lib/evas/canvas/evas_image.eo b/src/lib/evas/canvas/evas_image.eo index 323ae946d4..42cfc12652 100644 --- a/src/lib/evas/canvas/evas_image.eo +++ b/src/lib/evas/canvas/evas_image.eo @@ -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; diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 15f2b0c07f..60802326b1 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -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) |