aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2015-10-23 15:58:54 +0100
committerThomas White <taw@bitwiz.org.uk>2015-10-23 15:58:54 +0100
commit0c834391b9e544de81153d7dda1b064ce202933b (patch)
tree4d685162b77b293cbc24e866b16a307b86543c56
parent05fa0c9cc8a5df00f70859095634b33ce6449e97 (diff)
Logical width is needed at interpreting time
-rw-r--r--src/render.c10
-rw-r--r--src/render.h3
-rw-r--r--src/sc_editor.c5
3 files changed, 9 insertions, 9 deletions
diff --git a/src/render.c b/src/render.c
index b035893..9cef68f 100644
--- a/src/render.c
+++ b/src/render.c
@@ -419,7 +419,7 @@ int recursive_wrap(struct frame *fr, ImageStore *is, enum is_size isz)
struct frame *interp_and_shape(SCBlock *scblocks, SCBlock **stylesheets,
SCCallbackList *cbl, ImageStore *is,
enum is_size isz, int slide_number,
- cairo_t *cr)
+ cairo_t *cr, double w, double h)
{
cairo_font_options_t *fopts;
PangoFontMap *fontmap;
@@ -443,8 +443,8 @@ struct frame *interp_and_shape(SCBlock *scblocks, SCBlock **stylesheets,
top->resizable = 0;
top->x = 0.0;
top->y = 0.0;
- top->w = 0.0; /* not needed yet */
- top->h = 0.0; /* not needed yet */
+ top->w = w;
+ top->h = h;
scin = sc_interp_new(pc, top);
if ( scin == NULL ) {
@@ -488,10 +488,8 @@ static struct frame *render_sc_to_surface(SCBlock *scblocks, cairo_surface_t *su
cairo_fill(cr);
top = interp_and_shape(scblocks, stylesheets, cbl, is, isz,
- slide_number, cr);
+ slide_number, cr, log_w, log_h);
- top->w = log_w;
- top->h = log_h;
recursive_wrap(top, is, isz);
recursive_draw(top, cr, is, isz);
diff --git a/src/render.h b/src/render.h
index fe8ad84..88e333d 100644
--- a/src/render.h
+++ b/src/render.h
@@ -46,7 +46,8 @@ extern cairo_surface_t *render_sc(SCBlock *scblocks, int w, int h,
extern struct frame *interp_and_shape(SCBlock *scblocks, SCBlock **stylesheets,
SCCallbackList *cbl,
ImageStore *is, enum is_size isz,
- int slide_number, cairo_t *cr);
+ int slide_number, cairo_t *cr,
+ double w, double h);
extern int recursive_wrap(struct frame *fr, ImageStore *is, enum is_size isz);
diff --git a/src/sc_editor.c b/src/sc_editor.c
index 9fcf457..b41cb9e 100644
--- a/src/sc_editor.c
+++ b/src/sc_editor.c
@@ -103,7 +103,8 @@ static gboolean resize_sig(GtkWidget *widget, GdkEventConfigure *event,
if ( e->top == NULL ) {
cairo_t *cr = gdk_cairo_create(gtk_widget_get_window(widget));
e->top = interp_and_shape(e->scblocks, e->stylesheets, e->cbl,
- e->is, ISZ_EDITOR, 0, cr);
+ e->is, ISZ_EDITOR, 0, cr,
+ event->width, 0.0);
cairo_destroy(cr);
}
@@ -277,7 +278,7 @@ static void full_rerender(SCEditor *e)
cairo_t *cr = gdk_cairo_create(gtk_widget_get_window(GTK_WIDGET(e)));
e->top = interp_and_shape(e->scblocks, e->stylesheets, e->cbl,
- e->is, ISZ_EDITOR, 0, cr);
+ e->is, ISZ_EDITOR, 0, cr, e->w, 0.0);
cairo_destroy(cr);
e->top->x = 0.0;