aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-05-12 20:30:51 +0200
committerThomas White <taw@bitwiz.org.uk>2013-05-12 20:30:51 +0200
commiteb732a89ceef91b0b184100dc72d38b75bf65386 (patch)
tree6fd326d2f4dc67f6b1d27c7b1f7be28a20b750d3 /src
parentbc477b0f599bb3b25c1a30bf9852a7f8de243030 (diff)
Add lop_from_style
Diffstat (limited to 'src')
-rw-r--r--src/frame.h3
-rw-r--r--src/mainwindow.c4
-rw-r--r--src/render.c2
3 files changed, 6 insertions, 3 deletions
diff --git a/src/frame.h b/src/frame.h
index 2e645a6..bce1009 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -92,7 +92,8 @@ struct frame
size_t pos;
struct layout_parameters lop;
- struct style *style; /* Non-NULL if 'lop' came from SS */
+ struct style *style;
+ int lop_from_style;/* Trye if lop came from SS */
/* The rectangle allocated to this frame, determined by the renderer */
double x;
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 312c905..01e8062 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -555,6 +555,7 @@ static gint add_furniture(GtkWidget *widget, struct presentation *p)
fr = add_subframe(p->cur_edit_slide->top);
fr->style = sty;
+ fr->lop_from_style = 1;
set_edit(p, p->cur_edit_slide);
fr->sc = strdup("Hello");
fr->sc_len = 6;
@@ -1035,7 +1036,8 @@ static void create_frame(struct presentation *p, double x, double y,
fr = add_subframe(parent);
fr->sc = strdup("New frame!");
- fr->style = NULL;
+ fr->style = find_style(p->ss, "Content");
+ fr->lop_from_style = 0;
fr->lop.x = x;
fr->lop.y = y;
fr->lop.w = w;
diff --git a/src/render.c b/src/render.c
index 2c79253..fe52a26 100644
--- a/src/render.c
+++ b/src/render.c
@@ -289,7 +289,7 @@ static int render_frame(struct frame *fr, double scale)
struct frame *ch = fr->children[i];
double mtot;
- if ( ch->style != NULL ) {
+ if ( (ch->style != NULL) && ch->lop_from_style ) {
memcpy(&ch->lop, &ch->style->lop,
sizeof(struct layout_parameters));
}