aboutsummaryrefslogtreecommitdiff
path: root/libstorycode/slide.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2019-02-26 19:57:41 +0100
committerThomas White <taw@bitwiz.me.uk>2019-02-26 19:57:41 +0100
commit36a4bd7229a562d414513073d1123080b9615cd9 (patch)
treec473b435ca1165b69519f02ad9a5b8eafe693ef7 /libstorycode/slide.c
parentfd60b77df51cb24c33440ab7d9afe8043f9e43db (diff)
Use slide size from stylesheet when appropriate
Diffstat (limited to 'libstorycode/slide.c')
-rw-r--r--libstorycode/slide.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/libstorycode/slide.c b/libstorycode/slide.c
index 809f2cb..9db5995 100644
--- a/libstorycode/slide.c
+++ b/libstorycode/slide.c
@@ -40,8 +40,8 @@ Slide *slide_new()
if ( s == NULL ) return NULL;
s->n_items = 0;
s->items = NULL;
- s->logical_w = 1024.0;
- s->logical_h = 768.0;
+ s->logical_w = -1.0;
+ s->logical_h = -1.0;
return s;
}
@@ -198,9 +198,16 @@ int slide_set_logical_size(Slide *s, double w, double h)
}
-int slide_get_logical_size(Slide *s, double *w, double *h)
+int slide_get_logical_size(Slide *s, Stylesheet *ss, double *w, double *h)
{
if ( s == NULL ) return 1;
+
+ if ( s->logical_w < 0.0 ) {
+ /* Slide-specific value not set, use stylesheet */
+ stylesheet_get_slide_default_size(ss, w, h);
+ return 0;
+ }
+
*w = s->logical_w;
*h = s->logical_h;
return 0;