elm_spinner: Spinner value adjust when round enabled. 48/173348/2 accepted/tizen/4.0/unified/20180323.062110 submit/tizen_4.0/20180322.082432
authorWoochan Lee <wc0917.lee@samsung.com>
Wed, 21 Mar 2018 01:04:57 +0000 (10:04 +0900)
committerWoochan Lee <wc0917.lee@samsung.com>
Wed, 21 Mar 2018 01:44:58 +0000 (10:44 +0900)
The round value was not being applied when input the value as an internal entry.

https://phab.enlightenment.org/D5843

Change-Id: I991548bb3a1289a093d88dbe95a8c84aec556d99

src/lib/elm_spinner.c

index 8530af6..5379d52 100644 (file)
@@ -438,6 +438,12 @@ _entry_value_apply(Evas_Object *obj)
 
    val = strtod(str, &end);
    if (((*end != '\0') && (!isspace(*end))) || (fabs(val - sd->val) < DBL_EPSILON)) return;
+
+   //TIZEN_ONLY(20180321): Spinner value adjust when round enabled.
+   if (sd->round > 0)
+     val = sd->val_base + (double)((((int)(val - sd->val_base + (sd->round / 2.0))) / sd->round) * sd->round);
+   //
+
    elm_spinner_value_set(obj, val);
 
    eo_do(obj, eo_event_callback_call(ELM_SPINNER_EVENT_CHANGED, NULL));