elm_colorselector: fix horiz/vertical padding to be affected by base_scale in edc
authorSung-Taek Hong <sth253.hong@samsung.com>
Mon, 22 Jun 2015 09:55:52 +0000 (11:55 +0200)
committerCedric BAIL <cedric@osg.samsung.com>
Mon, 22 Jun 2015 10:36:57 +0000 (12:36 +0200)
Summary:
elm_colorselector get its padding size from data in edc.
However, when calculating the padding size, it does not consider
base_scale of the style from where it gets padding size.
In this commit, the padding size from edc is divided by its
base_scale so that desirable size can be calculated.

@fix

Reviewers: Hermet, woohyun

Subscribers: woohyun, Hermet

Differential Revision: https://phab.enlightenment.org/D2721

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/elm_colorselector.c

index 78bcb93..20915f0 100644 (file)
@@ -1114,8 +1114,8 @@ _elm_colorselector_elm_widget_theme_apply(Eo *obj, Elm_Colorselector_Data *sd)
 
         elm_box_padding_set
           (sd->palette_box,
-          (h_pad * elm_widget_scale_get(obj) * elm_config_scale_get()),
-          (v_pad * elm_widget_scale_get(obj) * elm_config_scale_get()));
+          (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()));
 
         EINA_LIST_FOREACH(sd->items, elist, eo_item)
           {
@@ -1605,8 +1605,8 @@ _create_colorpalette(Evas_Object *obj)
 
    elm_box_padding_set
      (sd->palette_box,
-     (h_pad * elm_widget_scale_get(obj) * elm_config_scale_get()),
-     (v_pad * elm_widget_scale_get(obj) * elm_config_scale_get()));
+     (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()));
 
    elm_box_align_set(sd->palette_box, 0.0, 0.0);
    if (!elm_layout_content_set(obj, "elm.palette", sd->palette_box))