From 6497ab1b885436c6312aeab0b5e2dd74c6917662 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 20 Aug 2014 22:31:54 +0200 Subject: Add SC when creating image frame --- src/mainwindow.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mainwindow.c b/src/mainwindow.c index c01ed1b..20a35b7 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -1973,7 +1973,7 @@ static void dnd_receive(GtkWidget *widget, GdkDragContext *drag_context, if ( filename != NULL ) { struct frame *fr; - char *sc; + char *opts; size_t len; int w, h; @@ -1984,19 +1984,20 @@ static void dnd_receive(GtkWidget *widget, GdkDragContext *drag_context, h = p->drag_corner_y - p->start_corner_y; len = strlen(filename)+64; - sc = malloc(len); - if ( sc == NULL ) { + opts = malloc(len); + if ( opts == NULL ) { free(filename); fprintf(stderr, "Failed to allocate SC\n"); return; } - snprintf(sc, len, "\\image[fitxfit]{%s}", filename); + snprintf(opts, len, "1fx1f+0+0,filename=\"%s\"", + filename); fr = create_frame(p, p->start_corner_x, p->start_corner_y, w, h); - /* FIXME Add scblocks and link into structure */ fr->is_image = 1; fr->empty = 0; + sc_block_append_inside(fr->scblocks, "image", opts, ""); show_hierarchy(p->cur_edit_slide->top, ""); rerender_slide(p); set_selection(p, fr); -- cgit v1.2.3