From 1a176d8f0963ff28d5dec5519b145f166ccd4860 Mon Sep 17 00:00:00 2001 From: Orange Date: Sun, 15 Mar 2026 18:48:22 +0300 Subject: [PATCH] fix --- source/hud/entity_overlay.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/hud/entity_overlay.cpp b/source/hud/entity_overlay.cpp index 7807bd2..2202dfb 100644 --- a/source/hud/entity_overlay.cpp +++ b/source/hud/entity_overlay.cpp @@ -57,7 +57,7 @@ namespace omath::hud ratio = std::clamp(ratio, 0.f, 1.f); const auto max_bar_height = std::abs(m_canvas.top_right_corner.y - m_canvas.bottom_right_corner.y); - const auto bar_start = m_canvas.bottom_right_corner + Vector2{offset, 0.f}; + const auto bar_start = Vector2{m_text_cursor_right.x + offset, m_canvas.bottom_right_corner.y}; m_renderer->add_filled_rectangle(bar_start, bar_start + Vector2(width, -max_bar_height), bg_color); m_renderer->add_filled_rectangle(bar_start, bar_start + Vector2(width, -max_bar_height * ratio), color); @@ -72,7 +72,7 @@ namespace omath::hud ratio = std::clamp(ratio, 0.f, 1.f); const auto max_bar_height = std::abs(m_canvas.top_left_corner.y - m_canvas.bottom_right_corner.y); - const auto bar_start = m_canvas.bottom_left_corner + Vector2{-(offset + width), 0.f}; + const auto bar_start = Vector2{m_text_cursor_left.x - (offset + width), m_canvas.bottom_left_corner.y}; m_renderer->add_filled_rectangle(bar_start, bar_start + Vector2(width, -max_bar_height), bg_color); m_renderer->add_filled_rectangle(bar_start, bar_start + Vector2(width, -max_bar_height * ratio), color); @@ -107,7 +107,7 @@ namespace omath::hud ratio = std::clamp(ratio, 0.f, 1.f); const auto max_bar_width = std::abs(m_canvas.top_left_corner.x - m_canvas.bottom_right_corner.x); - const auto bar_start = m_canvas.top_left_corner - Vector2{0.f, offset}; + const auto bar_start = Vector2{m_canvas.top_left_corner.x, m_text_cursor_top.y - offset}; m_renderer->add_filled_rectangle(bar_start, bar_start + Vector2(max_bar_width, -height), bg_color); m_renderer->add_filled_rectangle(bar_start, bar_start + Vector2(max_bar_width * ratio, -height), color); @@ -187,7 +187,7 @@ namespace omath::hud { ratio = std::clamp(ratio, 0.f, 1.f); const float height = std::abs(m_canvas.top_right_corner.y - m_canvas.bottom_right_corner.y); - const auto bar_start = m_canvas.bottom_right_corner + Vector2{offset, 0.f}; + const auto bar_start = Vector2{m_text_cursor_right.x + offset, m_canvas.bottom_right_corner.y}; m_renderer->add_filled_rectangle(bar_start, bar_start + Vector2{width, -height}, bg_color); draw_dashed_fill(bar_start, {0.f, -1.f}, {width, 0.f}, height, height * ratio, @@ -203,7 +203,7 @@ namespace omath::hud { ratio = std::clamp(ratio, 0.f, 1.f); const float height = std::abs(m_canvas.top_left_corner.y - m_canvas.bottom_left_corner.y); - const auto bar_start = m_canvas.bottom_left_corner + Vector2{-(offset + width), 0.f}; + const auto bar_start = Vector2{m_text_cursor_left.x - (offset + width), m_canvas.bottom_left_corner.y}; m_renderer->add_filled_rectangle(bar_start, bar_start + Vector2{width, -height}, bg_color); draw_dashed_fill(bar_start, {0.f, -1.f}, {width, 0.f}, height, height * ratio, @@ -219,7 +219,7 @@ namespace omath::hud { ratio = std::clamp(ratio, 0.f, 1.f); const float bar_w = std::abs(m_canvas.top_left_corner.x - m_canvas.top_right_corner.x); - const auto bar_start = m_canvas.top_left_corner - Vector2{0.f, offset}; + const auto bar_start = Vector2{m_canvas.top_left_corner.x, m_text_cursor_top.y - offset}; m_renderer->add_filled_rectangle(bar_start, bar_start + Vector2{bar_w, -height}, bg_color); draw_dashed_fill(bar_start, {1.f, 0.f}, {0.f, -height}, bar_w, bar_w * ratio, @@ -234,7 +234,7 @@ namespace omath::hud { ratio = std::clamp(ratio, 0.f, 1.f); const float bar_w = std::abs(m_canvas.bottom_left_corner.x - m_canvas.bottom_right_corner.x); - const auto bar_start = m_canvas.bottom_left_corner + Vector2{0.f, offset}; + const auto bar_start = Vector2{m_canvas.bottom_left_corner.x, m_text_cursor_bottom.y + offset}; m_renderer->add_filled_rectangle(bar_start, bar_start + Vector2{bar_w, height}, bg_color); draw_dashed_fill(bar_start, {1.f, 0.f}, {0.f, height}, bar_w, bar_w * ratio, @@ -349,7 +349,7 @@ namespace omath::hud ratio = std::clamp(ratio, 0.f, 1.f); const auto max_bar_width = std::abs(m_canvas.bottom_right_corner.x - m_canvas.bottom_left_corner.x); - const auto bar_start = m_canvas.bottom_left_corner + Vector2{0.f, offset}; + const auto bar_start = Vector2{m_canvas.bottom_left_corner.x, m_text_cursor_bottom.y + offset}; m_renderer->add_filled_rectangle(bar_start, bar_start + Vector2(max_bar_width, height), bg_color); m_renderer->add_filled_rectangle(bar_start, bar_start + Vector2(max_bar_width * ratio, height), color); m_renderer->add_rectangle(bar_start, bar_start + Vector2(max_bar_width, height), outline_color);