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.
|
/** Transform a string to a alignment_t type.
|
||||||
* Recognized string are flex, fixed, left, center or right. Everything else
|
* Recognized string are flex, fixed, left, center, middle or right.
|
||||||
* will be recognized as AlignLeft.
|
* Everything else will be recognized as AlignLeft.
|
||||||
* \param align Atring with align text.
|
* \param align Atring with align text.
|
||||||
* \param len The string length.
|
* \param len The string length.
|
||||||
* \return An alignment_t type.
|
* \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_FIXED: return AlignFixed;
|
||||||
case A_TK_TOP: return AlignTop;
|
case A_TK_TOP: return AlignTop;
|
||||||
case A_TK_BOTTOM: return AlignBottom;
|
case A_TK_BOTTOM: return AlignBottom;
|
||||||
|
case A_TK_MIDDLE: return AlignMiddle;
|
||||||
default: return AlignLeft;
|
default: return AlignLeft;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -723,6 +724,7 @@ draw_align_tostr(alignment_t a)
|
||||||
case AlignFixed: return "fixed";
|
case AlignFixed: return "fixed";
|
||||||
case AlignBottom: return "bottom";
|
case AlignBottom: return "bottom";
|
||||||
case AlignTop: return "top";
|
case AlignTop: return "top";
|
||||||
|
case AlignMiddle: return "middle";
|
||||||
default: return NULL;
|
default: return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1
draw.h
1
draw.h
|
@ -62,6 +62,7 @@ typedef enum
|
||||||
AlignBottom = (1 << 3),
|
AlignBottom = (1 << 3),
|
||||||
AlignFlex = (1 << 4),
|
AlignFlex = (1 << 4),
|
||||||
AlignFixed = (1 << 5),
|
AlignFixed = (1 << 5),
|
||||||
|
AlignMiddle = (1 << 6)
|
||||||
} alignment_t;
|
} alignment_t;
|
||||||
|
|
||||||
typedef struct vector_t vector_t;
|
typedef struct vector_t vector_t;
|
||||||
|
|
Loading…
Reference in New Issue