summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2018-04-13 00:11:11 +0200
committerPaweł Redman <pawel.redman@gmail.com>2018-04-13 00:11:11 +0200
commit0f3893774df7805929c5c996228449996c78640b (patch)
tree891a83176615b0996c547c20d99e1a36e4598745
parent440d57cec25e4d54584cff8c54b3f5ac5b72da9f (diff)
Another text alignment mode.
-rw-r--r--src/common.hpp3
-rw-r--r--src/render.cpp5
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;