From a32c1aa48a60f0d20a2dc237508ec9c2b5dcd729 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 4 Oct 2011 21:06:08 +0200 Subject: Update vertical alignment stuff --- src/tool_text.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/tool_text.c') diff --git a/src/tool_text.c b/src/tool_text.c index 0e3e43d..d40100f 100644 --- a/src/tool_text.c +++ b/src/tool_text.c @@ -143,11 +143,10 @@ static void calculate_position_from_style(struct text_object *o, o->base.y = o->base.style->margin_top; break; case V_BOTTOM : - o->base.y = ebottom - o->base.bb_height; + o->base.y = ebottom - yo; break; case V_CENTER : - o->base.y = mh/2.0 - o->base.bb_height/2.0 + yo - - o->base.style->offset_y; + o->base.y = mh/2.0 - yo/2.0 + o->base.style->offset_y; break; } @@ -157,11 +156,9 @@ static void calculate_position_from_style(struct text_object *o, o->base.y = o->base.style->margin_top; } - if ( o->base.y+yo + o->base.bb_height > mh - - o->base.style->margin_bottom ) + if ( o->base.y+yo + yo > ebottom ) { - o->base.y = mh-o->base.style->margin_bottom - - yo - o->base.bb_height; + o->base.y = ebottom - yo; } } } -- cgit v1.2.3