diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-24 23:46:19 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-24 23:46:19 +0200 |
commit | 7dc4078a73beb3648c4622437c9e4131b260110e (patch) | |
tree | 7b8d0ead7fe43d6580b30cdf569850a125861a64 /SharedGraphics | |
parent | 0c88ce9ee302ec295e903ef65b8e7d4b8758b9bd (diff) | |
download | serenity-7dc4078a73beb3648c4622437c9e4131b260110e.zip |
SharedGraphics: Add is_right_text_alignment(TextAlignment) helper.
This seems a tad bit more future-proof than manually checking all the valid
right-side TextAlignment values in clients.
Diffstat (limited to 'SharedGraphics')
-rw-r--r-- | SharedGraphics/TextAlignment.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/SharedGraphics/TextAlignment.h b/SharedGraphics/TextAlignment.h index da7fa18021..9f77c67179 100644 --- a/SharedGraphics/TextAlignment.h +++ b/SharedGraphics/TextAlignment.h @@ -1,3 +1,13 @@ #pragma once enum class TextAlignment { TopLeft, CenterLeft, Center, CenterRight }; + +inline bool is_right_text_alignment(TextAlignment alignment) +{ + switch (alignment) { + case TextAlignment::CenterRight: + return true; + default: + return false; + } +} |