+/* Draw one step of the hack. Positions are cell coordinates. */
+static void
+draw_step (CriticalSettings *settings,
+ Display *dpy, Window window, GC gc,
+ int pos, XPoint *history)
+{
+ int cell_size = settings->cell_size;
+ int half = cell_size/2;
+ int old_pos = (pos + settings->trail - 1) % settings->trail;
+
+ pos = pos % settings->trail;
+
+ XDrawLine (dpy, window, gc,
+ history[pos].x * cell_size + half,
+ history[pos].y * cell_size + half,
+ history[old_pos].x * cell_size + half,
+ history[old_pos].y * cell_size + half);
+}
+
+