diff options
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; } } } |