spinner: Fix initial value of the spinner.
authorRafael Antognolli <rafael.antognolli@linux.intel.com>
Fri, 1 Mar 2013 18:24:05 +0000 (15:24 -0300)
committerRafael Antognolli <rafael.antognolli@linux.intel.com>
Fri, 1 Mar 2013 18:24:05 +0000 (15:24 -0300)
The size should remain the same after the first mouse move and then be
adjusted accordingly.

Fixes #1403.

Patch by: "Brian J. Lovin" <brian.j.lovin@intel.com>

legacy/elementary/src/lib/elm_spinner.c

index 9bf6598..56ba3f5 100644 (file)
@@ -170,7 +170,7 @@ _drag_cb(void *data,
      (wd->resize_obj, "elm.dragable.slider", &pos, NULL);
 
    offset = sd->step * _elm_config->scale;
-   delta = (pos - sd->drag_start_pos) * offset;
+   delta = pos * offset;
    /* If we are on rtl mode, change the delta to be negative on such changes */
    if (elm_widget_mirrored_get(obj)) delta *= -1;
    if (_value_set(data, sd->drag_start_pos + delta)) _label_write(data);
@@ -183,14 +183,9 @@ _drag_start_cb(void *data,
                const char *emission __UNUSED__,
                const char *source __UNUSED__)
 {
-   double pos;
-
    ELM_SPINNER_DATA_GET(data, sd);
-   Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
 
-   edje_object_part_drag_value_get
-     (wd->resize_obj, "elm.dragable.slider", &pos, NULL);
-   sd->drag_start_pos = pos;
+   sd->drag_start_pos = sd->val;
 }
 
 static void