Skip to content

Commit

Permalink
Only send new graphwin data.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Plotkin authored and Andrew Plotkin committed Jan 5, 2017
1 parent b7ee1fc commit b20c507
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rgwin_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ window_graphics_t *win_graphics_create(window_t *win)
dwin->contentsize = 4;
dwin->content = (data_specialspan_t **)malloc(dwin->contentsize * sizeof(data_specialspan_t *));

dwin->updatemark = 0;

dwin->graphwidth = 0;
dwin->graphheight = 0;

Expand Down Expand Up @@ -68,6 +70,7 @@ void win_graphics_clear(window_t *win)
}

dwin->numcontent = 0;
dwin->updatemark = 0;

/* Put back the setcolor (if found). Note that contentsize is at
least 4. */
Expand Down Expand Up @@ -118,16 +121,18 @@ data_content_t *win_graphics_update(window_t *win)

data_content_t *dat = NULL;

if (dwin->numcontent) {
if (dwin->numcontent > dwin->updatemark) {
long px;
dat = data_content_alloc(win->updatetag, win->type);
data_line_t *line = data_line_alloc();
gen_list_append(&dat->lines, line);

for (px=0; px<dwin->numcontent; px++) {
for (px=dwin->updatemark; px<dwin->numcontent; px++) {
data_specialspan_t *span = dwin->content[px];
data_line_add_specialspan(line, span);
}

dwin->updatemark = dwin->numcontent;
}

return dat;
Expand Down
2 changes: 2 additions & 0 deletions rgwin_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ typedef struct window_graphics_struct {
data_specialspan_t **content;
long numcontent;
long contentsize;

long updatemark;

int graphwidth, graphheight;
} window_graphics_t;
Expand Down

0 comments on commit b20c507

Please sign in to comment.