aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2017-05-31 19:07:33 +0100
committerSmallJoker <SmallJoker@users.noreply.github.com>2017-05-31 20:07:33 +0200
commit6444963fb11279156e10fe9a25e6e22042f3d395 (patch)
tree123b6972989271b747db24270f6d6bc0e3e0daa2 /src
parent1681a009bc54b19eeab0356c7ed856bc0bed6a1a (diff)
downloadminetest-6444963fb11279156e10fe9a25e6e22042f3d395.tar.gz
minetest-6444963fb11279156e10fe9a25e6e22042f3d395.tar.bz2
minetest-6444963fb11279156e10fe9a25e6e22042f3d395.zip
Nametag: remove colour codes before calculating alignment. (#5862)
Diffstat (limited to 'src')
-rw-r--r--src/camera.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/camera.cpp b/src/camera.cpp
index 949494b00..52a42a3a9 100644
--- a/src/camera.cpp
+++ b/src/camera.cpp
@@ -558,9 +558,10 @@ void Camera::drawNametags()
f32 transformed_pos[4] = { pos.X, pos.Y, pos.Z, 1.0f };
trans.multiplyWith1x4Matrix(transformed_pos);
if (transformed_pos[3] > 0) {
+ std::string nametag_colorless = unescape_enriched(nametag->nametag_text);
core::dimension2d<u32> textsize =
g_fontengine->getFont()->getDimension(
- utf8_to_wide(nametag->nametag_text).c_str());
+ utf8_to_wide(nametag_colorless).c_str());
f32 zDiv = transformed_pos[3] == 0.0f ? 1.0f :
core::reciprocal(transformed_pos[3]);
v2u32 screensize = m_driver->getScreenSize();