jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e3de15d72642a61f57dda280befe458cb546c527

commit e3de15d72642a61f57dda280befe458cb546c527
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Wed Mar 2 19:39:41 2016 +0900

    Efl.Image: Fix documentation for ratio + implement in evas image
---
 src/lib/efl/interfaces/efl_image.eo     | 5 +++--
 src/lib/evas/canvas/evas_image.eo       | 1 +
 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 3b0efbf..2d5c01c 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 323ae94..42cfc12 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 15f2b0c..6080232 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)

-- 


Reply via email to