aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-09-03 22:37:57 +0200
committerThomas White <taw@bitwiz.org.uk>2013-09-03 22:37:57 +0200
commitca730b236f848f22a138435c4a645c15e0c5e6ea (patch)
tree5a84e8fe31941f0760152a4b2668b9424c46e914
parent2985aa57d9b23ea2e66819690364ac201ecf9cc5 (diff)
Fix negative-sized frames
-rw-r--r--src/frame.c10
-rw-r--r--src/mainwindow.c10
2 files changed, 20 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c
index d237895..5e10dbf 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -232,6 +232,16 @@ static int recursive_unpack(struct frame *fr, const char *sc, StyleSheet *ss)
sfr = add_subframe(fr);
parse_options(sfr, b->options, ss);
+ if ( sfr->lop.w < 0.0 ) {
+ sfr->lop.x += sfr->lop.w;
+ sfr->lop.w = -sfr->lop.w;
+ }
+
+ if ( sfr->lop.h < 0.0 ) {
+ sfr->lop.y += sfr->lop.h;
+ sfr->lop.h = -sfr->lop.h;
+ }
+
sfr->sc = remove_blocks(b->contents, "f");
sfr->sc_len = strlen(sfr->sc)+1;
if ( recursive_unpack(sfr, b->contents, ss) ) {
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 714b3ac..0830b02 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -1440,6 +1440,16 @@ static struct frame *create_frame(struct presentation *p, double x, double y,
parent = p->selection[0];
}
+ if ( w < 0.0 ) {
+ x += w;
+ w = -w;
+ }
+
+ if ( h < 0.0 ) {
+ y += h;
+ h = -h;
+ }
+
fr = add_subframe(parent);
fr->sc = NULL;
fr->style = default_style(p->ss);