shithub: neindaw

Download patch

ref: 1ee6f69e917666a6c1edfe697fffc29be220b6dc
parent: c32367bfe581fb67aff6597db4f24b3944028676
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Mar 18 22:14:14 EDT 2020

uiglue: reset on definition

--- a/uiglue.c
+++ b/uiglue.c
@@ -191,6 +191,7 @@
 ui_button(void *f, const char *label, float *zone)
 {
 	ui_define(f, UIButton, label, zone);
+	*zone = 0;
 }
 
 static void
@@ -197,6 +198,7 @@
 ui_checkbox(void *f, const char *label, float *zone)
 {
 	ui_define(f, UICheckBox, label, zone);
+	*zone = 0;
 }
 
 static void
@@ -205,7 +207,7 @@
 	UI *ui;
 
 	ui = ui_define(f, UIVSlider, label, zone);
-	ui->init = init;
+	ui->init = *zone = init;
 	ui->min = min;
 	ui->max = max;
 	ui->step = step;
@@ -217,7 +219,7 @@
 	UI *ui;
 
 	ui = ui_define(f, UIHSlider, label, zone);
-	ui->init = init;
+	ui->init = *zone = init;
 	ui->min = min;
 	ui->max = max;
 	ui->step = step;
@@ -229,7 +231,7 @@
 	UI *ui;
 
 	ui = ui_define(f, UINEntry, label, zone);
-	ui->init = init;
+	ui->init = *zone = init;
 	ui->min = min;
 	ui->max = max;
 	ui->step = step;
@@ -243,6 +245,7 @@
 	ui = ui_define(f, UIHBarGraph, label, zone);
 	ui->min = min;
 	ui->max = max;
+	*zone = 0;
 }
 
 static void
@@ -253,6 +256,7 @@
 	ui = ui_define(f, UIVBarGraph, label, zone);
 	ui->min = min;
 	ui->max = max;
+	*zone = 0;
 }
 
 static void