aboutsummaryrefslogtreecommitdiff
path: root/src/render.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2015-10-12 22:53:02 +0200
committerThomas White <taw@bitwiz.org.uk>2015-10-12 22:53:02 +0200
commit4e204b3e02f78ca60d32d0c704abcb5499384157 (patch)
treec726ddb3c6b8b4b0ad68ffb1719356bebeb0e6c8 /src/render.c
parenta8112c90cf0fdf44ceee5b54fed77468f5c15757 (diff)
Redraw on edit
Diffstat (limited to 'src/render.c')
-rw-r--r--src/render.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/render.c b/src/render.c
index 45c825e..651a262 100644
--- a/src/render.c
+++ b/src/render.c
@@ -1,7 +1,7 @@
/*
* render.c
*
- * Copyright © 2013-2014 Thomas White <taw@bitwiz.org.uk>
+ * Copyright © 2013-2015 Thomas White <taw@bitwiz.org.uk>
*
* This file is part of Colloquium.
*
@@ -381,21 +381,17 @@ static int draw_frame(cairo_t *cr, struct frame *fr, ImageStore *is,
}
-static int recursive_wrap_and_draw(struct frame *fr, cairo_t *cr,
- ImageStore *is, enum is_size isz)
+int recursive_draw(struct frame *fr, cairo_t *cr,
+ ImageStore *is, enum is_size isz)
{
int i;
- /* Wrap boxes -> wrap lines */
- wrap_contents(fr);
-
- /* Actually draw the lines */
draw_frame(cr, fr, is, isz);
for ( i=0; i<fr->num_children; i++ ) {
cairo_save(cr);
cairo_translate(cr, fr->children[i]->x, fr->children[i]->y);
- recursive_wrap_and_draw(fr->children[i], cr, is, isz);
+ recursive_draw(fr->children[i], cr, is, isz);
cairo_restore(cr);
}
@@ -403,6 +399,21 @@ static int recursive_wrap_and_draw(struct frame *fr, cairo_t *cr,
}
+static int recursive_wrap(struct frame *fr, ImageStore *is, enum is_size isz)
+{
+ int i;
+
+ /* Wrap boxes -> wrap lines */
+ wrap_contents(fr);
+
+ for ( i=0; i<fr->num_children; i++ ) {
+ recursive_wrap(fr->children[i], is, isz);
+ }
+
+ return 0;
+}
+
+
static struct frame *render_sc_to_surface(SCBlock *scblocks, cairo_surface_t *surf,
cairo_t *cr, double log_w, double log_h,
SCBlock **stylesheets, SCCallbackList *cbl,
@@ -460,7 +471,8 @@ static struct frame *render_sc_to_surface(SCBlock *scblocks, cairo_surface_t *su
}
}
sc_interp_add_blocks(scin, scblocks);
- recursive_wrap_and_draw(top, cr, is, isz);
+ recursive_wrap(top, is, isz);
+ recursive_draw(top, cr, is, isz);
sc_interp_destroy(scin);
cairo_font_options_destroy(fopts);