cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=1361f43735a878096dc40c1a29c6f13478f06a54

commit 1361f43735a878096dc40c1a29c6f13478f06a54
Author: j_yong.hwang <[email protected]>
Date:   Tue Jul 28 20:54:37 2015 +0200

    elm_colorselector: change operation order to limit float operation 
imprecision.
    
    Summary:
    The numerical formula below is calculated with the double type.
    -> h_pad / edje_object_base_scale_get(wd->resize_obj) * 
elm_widget_scale_get(obj) * elm_config_scale_get()
    
    But if number of significant figure of the return value goes over 15, the 
epsilon error will happen.
    Because of that, it is better to divide to do later.
    
    Reviewers: woohyun, raster, cedric
    
    Reviewed By: cedric
    
    Differential Revision: https://phab.enlightenment.org/D2872
    
    Signed-off-by: Cedric BAIL <[email protected]>
---
 src/lib/elm_colorselector.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lib/elm_colorselector.c b/src/lib/elm_colorselector.c
index 7b0a2c2..1a592b1 100644
--- a/src/lib/elm_colorselector.c
+++ b/src/lib/elm_colorselector.c
@@ -1139,8 +1139,8 @@ _elm_colorselector_elm_widget_theme_apply(Eo *obj, 
Elm_Colorselector_Data *sd)
 
         elm_box_padding_set
           (sd->palette_box,
-          (h_pad / edje_object_base_scale_get(wd->resize_obj) * 
elm_widget_scale_get(obj) * elm_config_scale_get()),
-          (v_pad / edje_object_base_scale_get(wd->resize_obj) * 
elm_widget_scale_get(obj) * elm_config_scale_get()));
+          (h_pad * elm_widget_scale_get(obj) * elm_config_scale_get() / 
edje_object_base_scale_get(wd->resize_obj)),
+          (v_pad * elm_widget_scale_get(obj) * elm_config_scale_get() / 
edje_object_base_scale_get(wd->resize_obj)));
 
         EINA_LIST_FOREACH(sd->items, elist, eo_item)
           {
@@ -1630,8 +1630,8 @@ _create_colorpalette(Evas_Object *obj)
 
    elm_box_padding_set
      (sd->palette_box,
-     (h_pad / edje_object_base_scale_get(wd->resize_obj) * 
elm_widget_scale_get(obj) * elm_config_scale_get()),
-     (v_pad / edje_object_base_scale_get(wd->resize_obj) * 
elm_widget_scale_get(obj) * elm_config_scale_get()));
+     (h_pad * elm_widget_scale_get(obj) * elm_config_scale_get() / 
edje_object_base_scale_get(wd->resize_obj)),
+     (v_pad * elm_widget_scale_get(obj) * elm_config_scale_get() / 
edje_object_base_scale_get(wd->resize_obj)));
 
    elm_box_align_set(sd->palette_box, 0.0, 0.0);
    if (!elm_layout_content_set(obj, "elm.palette", sd->palette_box))

-- 


Reply via email to