summaryrefslogtreecommitdiff
path: root/SharedGraphics
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-24 23:46:19 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-24 23:46:19 +0200
commit7dc4078a73beb3648c4622437c9e4131b260110e (patch)
tree7b8d0ead7fe43d6580b30cdf569850a125861a64 /SharedGraphics
parent0c88ce9ee302ec295e903ef65b8e7d4b8758b9bd (diff)
downloadserenity-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.h10
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;
+ }
+}