diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2018-04-13 00:11:11 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2018-04-13 00:11:11 +0200 |
commit | 0f3893774df7805929c5c996228449996c78640b (patch) | |
tree | 891a83176615b0996c547c20d99e1a36e4598745 | |
parent | 440d57cec25e4d54584cff8c54b3f5ac5b72da9f (diff) |
Another text alignment mode.
-rw-r--r-- | src/common.hpp | 3 | ||||
-rw-r--r-- | src/render.cpp | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/common.hpp b/src/common.hpp index 7d3a1f9..e6879ca 100644 --- a/src/common.hpp +++ b/src/common.hpp @@ -434,7 +434,8 @@ namespace render { typedef enum { ALIGN_LEFT_TOP, - ALIGN_CENTER_BOTTOM + ALIGN_CENTER_BOTTOM, + ALIGN_RIGHT_BOTTOM } text_align_t; void register_tile(uint8_t type, const char *top, const char *side, float height, layer_t layer); diff --git a/src/render.cpp b/src/render.cpp index 1dc6581..98c12a2 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -385,6 +385,11 @@ void state_t::render_text(v2f_t x, float height, std::string str, offset[0] = -rect.width / 2; offset[1] = -rect.height; break; + + case ALIGN_RIGHT_BOTTOM: + offset[0] = -rect.width; + offset[1] = -rect.height; + break; } offset *= scale; |