aboutsummaryrefslogtreecommitdiff
path: root/src/sc_interp.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-03-12 19:55:39 +0100
committerThomas White <taw@physics.org>2018-03-12 19:55:39 +0100
commit8164766c66c8d9149a7741e5625aef9d9fdac854 (patch)
tree5bc07c96024509ddf91728126f79977a53c16d81 /src/sc_interp.c
parentc7a86a47001baca65c87d0f060f9a57af8537cf2 (diff)
Add rscblocks for image and callback paragraphs
Diffstat (limited to 'src/sc_interp.c')
-rw-r--r--src/sc_interp.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/sc_interp.c b/src/sc_interp.c
index 5c3cd8c..c9f3d76 100644
--- a/src/sc_interp.c
+++ b/src/sc_interp.c
@@ -231,15 +231,17 @@ static void do_callback(SCInterpreter *scin, SCBlock *bl, const char *name)
double w, h;
int r;
void *bvp;
- SCBlock *mr;
+ SCBlock *rbl;
- mr = sc_interp_get_macro_real_block(scin);
- if ( mr == NULL ) mr = bl;
+ rbl = bl;
+ if ( sc_interp_get_macro_real_block(scin) != NULL ) {
+ bl = sc_interp_get_macro_real_block(scin);
+ }
if ( strcmp(cbl->names[i], name) != 0 ) continue;
r = cbl->box_funcs[i](scin, bl, &w, &h, &bvp, cbl->vps[i]);
if ( !r ) return;
- add_callback_para(sc_interp_get_frame(scin), bl, w, h,
+ add_callback_para(sc_interp_get_frame(scin), bl, rbl, w, h,
cbl->draw_funcs[i], cbl->click_funcs[i],
bvp, cbl->vps[i]);
@@ -988,11 +990,11 @@ static int check_outputs(SCBlock *bl, SCInterpreter *scin)
if ( parse_image_options(options, sc_interp_get_frame(scin),
&w, &h, &filename) == 0 )
{
- SCBlock *ebl = bl;
+ SCBlock *rbl = bl;
if ( st->macro_real_block != NULL ) {
- ebl = st->macro_real_block;
+ rbl = st->macro_real_block;
}
- add_image_para(sc_interp_get_frame(scin), ebl,
+ add_image_para(sc_interp_get_frame(scin), bl, rbl,
filename, scin->is, w, h, 1);
free(filename);
} else {