Fix blit_plane

This edit will make sure blit_plane only acts if all workers have
completed their drawing, since it's not much use otherwise.
This commit is contained in:
Petar Kapriš 2025-10-13 22:06:43 +02:00
parent 99fc7ce405
commit 64f921eff7

13
visor.c
View file

@ -342,8 +342,17 @@ void blit_plane(GtkDrawingArea *da, cairo_t *cr, int width, int height, gpointer
(void) width;
(void) height;
(void) data;
cairo_set_source_surface(cr, surface, 0, 0);
cairo_paint(cr);
bool allWritersHadCompleted = true;
for (int32_t i = 0; i < thread_count; i++) {
if (!threads[i].complete) {
allWritersHadCompleted = false;
break;
}
}
if (allWritersHadCompleted) {
cairo_set_source_surface(cr, surface, 0, 0);
cairo_paint(cr);
}
}
void plane_resize(GtkWidget *widget)