ryuan pushed a commit to branch master.

commit 434f3ca78bb3f70075eb36057fce2ca97c38393c
Author: Ryuan Choi <[email protected]>
Date:   Fri Aug 30 11:44:43 2013 +0900

    colorselector: minor refactoring. remove unnecessary local variable
---
 src/lib/elm_colorselector.c | 38 ++++++++------------------------------
 1 file changed, 8 insertions(+), 30 deletions(-)

diff --git a/src/lib/elm_colorselector.c b/src/lib/elm_colorselector.c
index 3a5bebd..1c1d9b5 100644
--- a/src/lib/elm_colorselector.c
+++ b/src/lib/elm_colorselector.c
@@ -799,16 +799,11 @@ _button_clicked_cb(void *data,
                    Evas_Object *obj,
                    void *event_info __UNUSED__)
 {
-   Eina_Bool is_right = EINA_FALSE;
    Color_Bar_Data *cb_data = data;
    double x, y, step;
    ELM_COLORSELECTOR_DATA_GET(cb_data->parent, sd);
 
-   if (obj == cb_data->rbt)
-     {
-        is_right = EINA_TRUE;
-        step = 1.0;
-     }
+   if (obj == cb_data->rbt) step = 1.0;
    else step = -1.0;
 
    edje_object_part_drag_value_get(cb_data->colorbar, "elm.arrow", &x, &y);
@@ -835,14 +830,8 @@ _button_clicked_cb(void *data,
         break;
      }
 
-   if (is_right)
-     {
-        if (x > 1.0) x = 1.0;
-     }
-   else
-     {
-        if (x < 0.0) x = 0.0;
-     }
+   if (x > 1.0) x = 1.0;
+   else if (x < 0.0) x = 0.0;
 
    edje_object_part_drag_value_set(cb_data->colorbar, "elm.arrow", x, y);
    _update_hsla_from_colorbar(cb_data->parent, cb_data->color_type, x);
@@ -855,28 +844,17 @@ _button_repeat_cb(void *data,
                   Evas_Object *obj __UNUSED__,
                   void *event_info __UNUSED__)
 {
-   Eina_Bool is_right = EINA_FALSE;
    Color_Bar_Data *cb_data = data;
    double x, y, step;
 
-   if (obj == cb_data->rbt)
-     {
-        is_right = EINA_TRUE;
-        step = 1.0;
-     }
-   else step = -1.0;
+   if (obj == cb_data->rbt) step = 1.0 / BASE_STEP;
+   else step = -1.0 / BASE_STEP;
 
    edje_object_part_drag_value_get(cb_data->colorbar, "elm.arrow", &x, &y);
-   x += step / BASE_STEP;
+   x += step;
 
-   if (is_right)
-     {
-        if (x > 1.0) x = 1.0;
-     }
-   else
-     {
-        if (x < 0.0) x = 0.0;
-     }
+   if (x > 1.0) x = 1.0;
+   else if (x < 0.0) x = 0.0;
 
    edje_object_part_drag_value_set(cb_data->colorbar, "elm.arrow", x, y);
    _update_hsla_from_colorbar(cb_data->parent, cb_data->color_type, x);

-- 

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk

Reply via email to