summaryrefslogtreecommitdiff
path: root/src/lib/evas/common
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2017-08-30 11:40:26 -0700
committerCedric Bail <cedric@osg.samsung.com>2017-08-30 12:06:01 -0700
commit2b9a2692e8e2f3ed60fdf1e111ea5ffe1dfe0dcf (patch)
treed8f9581a82954b16ea8bd07b09459c106c166bcc /src/lib/evas/common
parent67d1c0e51c01ba159f88adc6446cc31cee79c808 (diff)
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 <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/evas/common')
-rw-r--r--src/lib/evas/common/evas_font_query.c4
1 files 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
755 if (text_props->bidi_dir == EVAS_BIDI_DIRECTION_LTR) 755 if (text_props->bidi_dir == EVAS_BIDI_DIRECTION_LTR)
756 { 756 {
757 double part; 757 double part;
758 part = cluster_adv / items; 758 part = (double) cluster_adv / items;
759 item_pos = (int) ((x - cluster_start) / part); 759 item_pos = (int) ((x - cluster_start) / part);
760 } 760 }
761 else 761 else
762 { 762 {
763 double part; 763 double part;
764 part = cluster_adv / items; 764 part = (double) cluster_adv / items;
765 item_pos = items - ((int) ((x - cluster_start) / part)) - 1; 765 item_pos = items - ((int) ((x - cluster_start) / part)) - 1;
766 } 766 }
767 767