aboutsummaryrefslogtreecommitdiff
path: root/libstorycode/slide_render_cairo.c
diff options
context:
space:
mode:
Diffstat (limited to 'libstorycode/slide_render_cairo.c')
-rw-r--r--libstorycode/slide_render_cairo.c40
1 files changed, 15 insertions, 25 deletions
diff --git a/libstorycode/slide_render_cairo.c b/libstorycode/slide_render_cairo.c
index bbfc0f9..32bd236 100644
--- a/libstorycode/slide_render_cairo.c
+++ b/libstorycode/slide_render_cairo.c
@@ -46,16 +46,6 @@
#include "slide_priv.h"
-static double slide_lcalc(struct length l, double pd)
-{
- if ( l.unit == LENGTH_UNIT ) {
- return l.len;
- } else {
- return l.len * pd;
- }
-}
-
-
static int slide_positions_equal(struct slide_pos a, struct slide_pos b)
{
if ( a.para != b.para ) return 0;
@@ -206,15 +196,15 @@ static void render_text(SlideItem *item, cairo_t *cr, PangoContext *pc,
} else {
stylesheet_get_geometry(ss, stn, &geom);
}
- x = slide_lcalc(geom.x, parent_w);
- y = slide_lcalc(geom.y, parent_h);
- w = slide_lcalc(geom.w, parent_w);
- h = slide_lcalc(geom.h, parent_h);
+ x = lcalc(geom.x, parent_w);
+ y = lcalc(geom.y, parent_h);
+ w = lcalc(geom.w, parent_w);
+ h = lcalc(geom.h, parent_h);
if ( stylesheet_get_padding(ss, stn, pad) ) return;
- pad_l = slide_lcalc(pad[0], parent_w);
- pad_r = slide_lcalc(pad[1], parent_w);
- pad_t = slide_lcalc(pad[2], parent_h);
+ pad_l = lcalc(pad[0], parent_w);
+ pad_r = lcalc(pad[1], parent_w);
+ pad_t = lcalc(pad[2], parent_h);
font = stylesheet_get_font(ss, stn, &fgcol, &align);
if ( font == NULL ) return;
@@ -242,10 +232,10 @@ static void render_text(SlideItem *item, cairo_t *cr, PangoContext *pc,
do_background(ss, stn, cr, x, y, w, h);
if ( stylesheet_get_paraspace(ss, stn, paraspacel) == 0 ) {
- paraspace[0] = slide_lcalc(paraspacel[0], w);
- paraspace[1] = slide_lcalc(paraspacel[1], w);
- paraspace[2] = slide_lcalc(paraspacel[2], h);
- paraspace[3] = slide_lcalc(paraspacel[3], h);
+ paraspace[0] = lcalc(paraspacel[0], w);
+ paraspace[1] = lcalc(paraspacel[1], w);
+ paraspace[2] = lcalc(paraspacel[2], h);
+ paraspace[3] = lcalc(paraspacel[3], h);
} else {
paraspace[0] = 0.0;
paraspace[1] = 0.0;
@@ -331,10 +321,10 @@ static void render_image(SlideItem *item, cairo_t *cr,
double wd, hd;
cairo_surface_t *surf;
- x = slide_lcalc(item->geom.x, parent_w);
- y = slide_lcalc(item->geom.y, parent_h);
- w = slide_lcalc(item->geom.w, parent_w);
- h = slide_lcalc(item->geom.h, parent_h);
+ x = lcalc(item->geom.x, parent_w);
+ y = lcalc(item->geom.y, parent_h);
+ w = lcalc(item->geom.w, parent_w);
+ h = lcalc(item->geom.h, parent_h);
wd = w; hd = h;
cairo_user_to_device_distance(cr, &wd, &hd);