aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2014-08-20 22:31:54 +0200
committerThomas White <taw@bitwiz.org.uk>2014-08-20 22:31:54 +0200
commit6497ab1b885436c6312aeab0b5e2dd74c6917662 (patch)
tree6012d1b9dedd5ef92a07590461d4cca3f7786002
parent2b060821379df8183c2d80f9309b2a4cc0f7b95d (diff)
Add SC when creating image frame
-rw-r--r--src/mainwindow.c11
1 files changed, 6 insertions, 5 deletions
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);