aboutsummaryrefslogtreecommitdiff
path: root/src/tool_text.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2011-10-04 21:06:08 +0200
committerThomas White <taw@bitwiz.org.uk>2011-10-04 21:06:08 +0200
commita32c1aa48a60f0d20a2dc237508ec9c2b5dcd729 (patch)
treec38c4b495679744f34b23355601964375f436175 /src/tool_text.c
parent224be95caab86b030a5cf11d585ffabb34d4daf5 (diff)
Update vertical alignment stuff
Diffstat (limited to 'src/tool_text.c')
-rw-r--r--src/tool_text.c11
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;
}
}
}