From 970b56658026425af014eee6f7bf7bf9a4a1cc7a Mon Sep 17 00:00:00 2001 From: Lionel Ott Date: Fri, 6 Mar 2009 13:43:03 +0100 Subject: [PATCH] Added AlignMiddle to alignment_t structure - Added AlignMiddle to denote a vertically centered element Signed-off-by: Julien Danjou --- draw.c | 6 ++++-- draw.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/draw.c b/draw.c index 5b8445d5..aa796832 100644 --- a/draw.c +++ b/draw.c @@ -686,8 +686,8 @@ draw_text_extents(draw_text_context_t *data) } /** Transform a string to a alignment_t type. - * Recognized string are flex, fixed, left, center or right. Everything else - * will be recognized as AlignLeft. + * Recognized string are flex, fixed, left, center, middle or right. + * Everything else will be recognized as AlignLeft. * \param align Atring with align text. * \param len The string length. * \return An alignment_t type. @@ -703,6 +703,7 @@ draw_align_fromstr(const char *align, ssize_t len) case A_TK_FIXED: return AlignFixed; case A_TK_TOP: return AlignTop; case A_TK_BOTTOM: return AlignBottom; + case A_TK_MIDDLE: return AlignMiddle; default: return AlignLeft; } } @@ -723,6 +724,7 @@ draw_align_tostr(alignment_t a) case AlignFixed: return "fixed"; case AlignBottom: return "bottom"; case AlignTop: return "top"; + case AlignMiddle: return "middle"; default: return NULL; } } diff --git a/draw.h b/draw.h index fde0e760..be14e8e1 100644 --- a/draw.h +++ b/draw.h @@ -62,6 +62,7 @@ typedef enum AlignBottom = (1 << 3), AlignFlex = (1 << 4), AlignFixed = (1 << 5), + AlignMiddle = (1 << 6) } alignment_t; typedef struct vector_t vector_t;