aboutsummaryrefslogtreecommitdiff
path: root/src/client/camera.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/camera.cpp')
-rw-r--r--src/client/camera.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/camera.cpp b/src/client/camera.cpp
index fd60e6dde..994497224 100644
--- a/src/client/camera.cpp
+++ b/src/client/camera.cpp
@@ -676,11 +676,12 @@ void Camera::drawNametags()
screen_pos.Y = screensize.Y *
(0.5 - transformed_pos[1] * zDiv * 0.5) - textsize.Height / 2;
core::rect<s32> size(0, 0, textsize.Width, textsize.Height);
- core::rect<s32> bg_size(-2, 0, textsize.Width+2, textsize.Height);
auto bgcolor = nametag->getBgColor(m_show_nametag_backgrounds);
- if (bgcolor.getAlpha() != 0)
+ if (bgcolor.getAlpha() != 0) {
+ core::rect<s32> bg_size(-2, 0, textsize.Width + 2, textsize.Height);
driver->draw2DRectangle(bgcolor, bg_size + screen_pos);
+ }
font->draw(
translate_string(utf8_to_wide(nametag->text)).c_str(),