commit c2680b8b9b05318ec7874883adddcaaf4fdd4d47
Author: Michael Day <contact@michaelcday.com>
AuthorDate: Sat Sep 23 18:32:22 2023 -0400
Commit: Turo Lamminen <turol@users.noreply.github.com>
CommitDate: Tue Sep 26 13:14:19 2023 +0300
textscreen: Set buffer when init-ing spincontrol
This fixes a bug where if a spincontrol is the first widget in a window,
its value gets reset to 0 every time that window is opened.
---
textscreen/txt_spinctrl.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/textscreen/txt_spinctrl.c b/textscreen/txt_spinctrl.c
index 465e4e4a..2a93e96e 100644
--- a/textscreen/txt_spinctrl.c
+++ b/textscreen/txt_spinctrl.c
@@ -404,6 +404,7 @@ txt_spincontrol_t *TXT_NewSpinControl(int *value, int min, int max)
spincontrol->min.i = min;
spincontrol->max.i = max;
spincontrol->step.i = 1;
+ SetBuffer(spincontrol);
return spincontrol;
}
@@ -418,6 +419,7 @@ txt_spincontrol_t *TXT_NewFloatSpinControl(float *value, float min, float max)
spincontrol->min.f = min;
spincontrol->max.f = max;
spincontrol->step.f = 0.1f;
+ SetBuffer(spincontrol);
return spincontrol;
}