shithub: neindaw

Download patch

ref: 206bcf72080c62575f3a343e8dab8f83bcb1171a
parent: 2e75e7f6eaa16f526a71bfdef4be4107ca392584
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Sun Jan 12 17:40:45 EST 2020

cfg: remove stupid fabs

--- a/cfg/cfg.c
+++ b/cfg/cfg.c
@@ -248,11 +248,9 @@
 			v = c->value;
 			snprint(tmp, sizeof(tmp), "%%g%s", c->unit == nil ? "" : c->unit);
 			if (mu_slider_ex(&v, c->min, c->max, c->step, tmp, MU_OPT_ALIGNCENTER) & MU_RES_CHANGE) {
-				if (fabs(fabs(v) - fabs(c->value)) >= c->step) {
-					n = snprint(tmp, sizeof(tmp), "%g", v);
-					if (write(c->ctl, tmp, n) > 0)
-						c->value = v;
-				}
+				n = snprint(tmp, sizeof(tmp), "%g", v);
+				if (write(c->ctl, tmp, n) > 0)
+					c->value = v;
 			}
 			mu_pop_id();
 		case UINEntry: