Added AlignMiddle to alignment_t structure
- Added AlignMiddle to denote a vertically centered element Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
cc54c32c5f
commit
970b566580
6
draw.c
6
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue