mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibGfx: Add a helper to check if a TextAlignment is vertically centered
This commit is contained in:
parent
95eeb321f9
commit
5f8a9d348d
Notes:
sideshowbarker
2024-07-19 02:19:51 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5f8a9d348d1
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)
|
||||
{
|
||||
#define __ENUMERATE(x) \
|
||||
|
|
Loading…
Add table
Reference in a new issue