cedric pushed a commit to branch master.

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

commit 2b9a2692e8e2f3ed60fdf1e111ea5ffe1dfe0dcf
Author: Youngbok Shin <youngb.s...@samsung.com>
Date:   Wed Aug 30 11:40:26 2017 -0700

    evas font: do floating point division for calculating more accurately
    
    Summary:
    Assigning a result of integral division to a double type variable is
    not useful for next division calculation. For more accurate calculation,
    it needs to be casted to double before doing division.
    It does not fix some bugs. It was reported by a code quality advisor.
    
    Test Plan: N/A
    
    Reviewers: raster, cedric, jpeg, herdsman, eunue
    
    Reviewed By: cedric
    
    Differential Revision: https://phab.enlightenment.org/D5069
    
    Signed-off-by: Cedric Bail <ced...@osg.samsung.com>
---
 src/lib/evas/common/evas_font_query.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/evas/common/evas_font_query.c 
b/src/lib/evas/common/evas_font_query.c
index c52486b3cb..081f9a5e54 100644
--- a/src/lib/evas/common/evas_font_query.c
+++ b/src/lib/evas/common/evas_font_query.c
@@ -755,13 +755,13 @@ evas_common_font_query_char_at_coords(RGBA_Font *fn, 
const Evas_Text_Props *text
         if (text_props->bidi_dir == EVAS_BIDI_DIRECTION_LTR)
           {
              double part;
-             part = cluster_adv / items;
+             part = (double) cluster_adv / items;
              item_pos = (int) ((x - cluster_start) / part);
           }
         else
           {
              double part;
-             part = cluster_adv / items;
+             part = (double) cluster_adv / items;
              item_pos = items - ((int) ((x - cluster_start) / part)) - 1;
           }
 

-- 


Reply via email to