mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-22 02:49:29 +03: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
@ -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…
Reference in New Issue
Block a user