mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +00:00
LibGfx: Add a helper to check if a TextAlignment is vertically centered
This commit is contained in:
parent
95eeb321f9
commit
5f8a9d348d
1 changed files with 12 additions and 0 deletions
|
@ -57,6 +57,18 @@ inline bool is_right_text_alignment(TextAlignment alignment)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool is_vertically_centered_text_alignment(TextAlignment alignment)
|
||||||
|
{
|
||||||
|
switch (alignment) {
|
||||||
|
case TextAlignment::CenterLeft:
|
||||||
|
case TextAlignment::CenterRight:
|
||||||
|
case TextAlignment::Center:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
inline Optional<TextAlignment> text_alignment_from_string(const StringView& string)
|
inline Optional<TextAlignment> text_alignment_from_string(const StringView& string)
|
||||||
{
|
{
|
||||||
#define __ENUMERATE(x) \
|
#define __ENUMERATE(x) \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue