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 <cedric@osg.samsung.com>
This commit is contained in:
j_yong.hwang 2015-07-28 20:54:37 +02:00 committed by Cedric BAIL
parent 15ede0ce70
commit 1be2af1529
1 changed files with 4 additions and 4 deletions

View File

@ -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))