theme: use FLOOR rounding for digital clock themes
authorMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 30 Jun 2017 18:59:21 +0000 (14:59 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 30 Jun 2017 18:59:59 +0000 (14:59 -0400)
the default rounding method allows for a value of 60 when setting the
seconds on a clock

fix T5639

data/elementary/themes/edc/clock.edc
data/elementary/themes/edc/time.edc

index a6ccdaa..4025882 100644 (file)
@@ -114,7 +114,8 @@ group { name: "e/modules/clock/digital";
          date(year, month, day, yearday, weekday, hour, minute, second);
          dosec = get_int(do_seconds);
          if (dosec) {
-            v = round(second);
+            v = round(second, FLOOR);
+            v = v % 60;
             tim = timer(1.0 - (second - v), "clock_cb", 1);
             // set seconds to v
             valset("s0", v / 10);
@@ -581,7 +582,7 @@ group { name: "e/modules/clock/main";
             date(year, month, day, yearday, weekday, hour, minute, second);
             dosec = get_int(do_seconds);
             if (dosec) {
-               v = round(second);
+               v = round(second, FLOOR);
                tim = timer(1.0 - (second - v), "clock_cb", 1);
                
                custom_state(PART:"seconds", "default", 0.0);
index 712d4a7..27afb75 100644 (file)
@@ -276,7 +276,7 @@ group { name: "e/gadget/clock/digital";
 #endif         
          dosec = get_int(do_seconds);
          if (dosec) {
-            v = round(second);
+            v = round(second, FLOOR);
             tim = timer(1.0 - (second - v), "clock_cb", 1);
             // set seconds to v
             valset("s0", v / 10);
@@ -792,7 +792,7 @@ group { name: "e/gadget/clock/analog";
 #endif
             dosec = get_int(do_seconds);
             if (dosec) {
-               v = round(second);
+               v = round(second, FLOOR);
                tim = timer(1.0 - (second - v), "clock_cb", 1);
                
                custom_state(PART:"seconds", "default", 0.0);