mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibGfx: Add a helper to check if a TextAlignment is vertically centered
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 02:19:51 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5f8a9d348d1
@@ -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) \
|
||||
|
||||
Reference in New Issue
Block a user