diff options
| author | iamcheeseman <[email protected]> | 2026-05-18 21:06:42 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-05-18 21:06:42 -0400 |
| commit | 51a249763e2a28a0c0a0f182fb3752aac9380317 (patch) | |
| tree | 3ff4f552e2ba8e372a222eff3b9791702be67c65 /dc/dc.c | |
| parent | dcfe8e6f08b1722639ad8e64db7553c60d3c7d11 (diff) | |
add rounding to sliders
Diffstat (limited to 'dc/dc.c')
| -rw-r--r-- | dc/dc.c | 16 |
1 files changed, 3 insertions, 13 deletions
@@ -82,26 +82,16 @@ void tick(void) if (tyui_button("press me")) toggled = !toggled; - tyui_layout((float[]){0.1, 0.2, 0.5, 0.1, 0}); + tyui_layout((float[]){0.1, 0.2, 0}); static float xvalue = 10; tyui_text("x"); tyui_text("%g", xvalue); - tyui_slider(0, 100, 1, &xvalue); - if (tyui_button("^")) - xvalue++; - if (tyui_button("v")) - xvalue--; - xvalue = floor(xvalue); + tyui_slider(0, 100, 5, &xvalue); static float yvalue = 50; tyui_text("y"); tyui_text("%g", yvalue); - tyui_slider(0, 100, 1, &yvalue); - if (tyui_button("^")) - yvalue++; - if (tyui_button("v")) - yvalue--; - yvalue = floor(yvalue); + tyui_slider(0, 100, 5, &yvalue); tyui_layout(NULL); tyui_end_window(); |
