diff options
author | Thomas White <taw@bitwiz.org.uk> | 2011-10-04 21:06:08 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2011-10-04 21:06:08 +0200 |
commit | a32c1aa48a60f0d20a2dc237508ec9c2b5dcd729 (patch) | |
tree | c38c4b495679744f34b23355601964375f436175 /src/tool_text.c | |
parent | 224be95caab86b030a5cf11d585ffabb34d4daf5 (diff) |
Update vertical alignment stuff
Diffstat (limited to 'src/tool_text.c')
-rw-r--r-- | src/tool_text.c | 11 |
1 files changed, 4 insertions, 7 deletions
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; } } } |