aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-09-03 22:14:44 +0200
committerThomas White <taw@physics.org>2017-09-03 22:14:44 +0200
commit2c90cac08fb74e910a4833b01baee3d5db792f73 (patch)
treef8ca61ce573edb0645e7df33be6e42055e06e7a2
parent9a6dd38bdb2c29f91e0fa9117937944d41dc7f22 (diff)
debugger: Avoid problems when a run gets deleted
-rw-r--r--src/debugger.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/debugger.c b/src/debugger.c
index 531969c..32cea14 100644
--- a/src/debugger.c
+++ b/src/debugger.c
@@ -207,6 +207,7 @@ static gboolean draw_sig(GtkWidget *da, cairo_t *cr, struct debugwindow *dbgw)
double ypos = 10.0;
int dpos = 0;
int changesig = 0;
+ int npr = 10; /* Not zero */
/* Background */
width = gtk_widget_get_allocated_width(GTK_WIDGET(da));
@@ -229,6 +230,10 @@ static gboolean draw_sig(GtkWidget *da, cairo_t *cr, struct debugwindow *dbgw)
enum para_type t = para_type(dbgw->fr->paras[i]);
+ /* Jump the "old values" pointer forward to the next paragraph start */
+ while ( dbgw->runs[dpos].np == npr ) dpos++;
+ npr = dbgw->runs[dpos].np;
+
plot_hr(cr, &ypos, width);
snprintf(tmp, 255, "Paragraph %i: type %s", i, str_type(t));
plot_text(cr, &ypos, fontdesc, tmp);