From 85dc7ac3280e0e1138b7134c765a9da38463fcf8 Mon Sep 17 00:00:00 2001 From: leonmavr <0xleo.git@gmail.com> Date: Mon, 16 Sep 2024 16:07:40 +0200 Subject: [PATCH] Clean all rectangles unconditionally --- src/viz.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/viz.c b/src/viz.c index b7aa13a..4e37ee7 100644 --- a/src/viz.c +++ b/src/viz.c @@ -23,7 +23,7 @@ void viz_init(unsigned width, unsigned height) { void viz_flush() { // remove all previously drawn rectangles - for (int i = 0; i < irect; ++i) { + for (int i = 0; i < NOBJECTS; ++i) { fprintf(viz_plot_pipe, "unset object %d\n", i + 1); } for (int i = 0; i < irect; ++i) { @@ -42,8 +42,7 @@ void viz_flush() { fprintf(viz_plot_pipe, "replot\n"); irect = ipoint = 0; fflush(viz_plot_pipe); - // 20 fps - usleep(50000); + usleep(16000); }