aboutsummaryrefslogtreecommitdiff
path: root/src/client/camera.cpp
diff options
context:
space:
mode:
authorHerman Semenov <GermanAizek@yandex.ru>2022-09-06 13:21:09 +0300
committerGitHub <noreply@github.com>2022-09-06 11:21:09 +0100
commit038da00e799b4bf3af824075a260083c56392964 (patch)
tree8c0e3218455073684c2521cec41b7df06fff8598 /src/client/camera.cpp
parentff6dcfea82974df6db5a557e31aaddb6bdb7a71f (diff)
downloadminetest-038da00e799b4bf3af824075a260083c56392964.tar.xz
Code optimizations / refactor (#12704)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com> Co-authored-by: sfan5 <sfan5@live.de>
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(),