From 1e9f4fb7ca952e0c9e885158eee4688afa05a01f Mon Sep 17 00:00:00 2001 From: cl1xa <104751596+cl1xa@users.noreply.github.com> Date: Tue, 3 May 2022 09:03:39 -0400 Subject: [PATCH] fix(ESP): Elements getting cut off on screen edges (#160) Co-authored-by: Caden <82620517+cl52902@users.noreply.github.com> --- BigBaseV2/src/views/esp/view_esp.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/BigBaseV2/src/views/esp/view_esp.cpp b/BigBaseV2/src/views/esp/view_esp.cpp index 83b1f98d..964f05f6 100644 --- a/BigBaseV2/src/views/esp/view_esp.cpp +++ b/BigBaseV2/src/views/esp/view_esp.cpp @@ -26,10 +26,10 @@ namespace big static ImColor health_red_bg = ImColor(0.69f, 0.29f, 0.29f, 0.5f); static ImColor health_red = ImColor(0.69f, 0.29f, 0.29f, 1.f); - ImGui::SetNextWindowSize({ (float)*g_pointers->m_resolution_x, (float)*g_pointers->m_resolution_y }); - if (ImGui::Begin("draw_window", nullptr, ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoFocusOnAppearing)) + ImDrawList* draw_list = ImGui::GetBackgroundDrawList(); + + if (draw_list) { - ImDrawList* draw_list = ImGui::GetWindowDrawList(); for (auto& item : g_player_service->m_players) { const std::unique_ptr& plyr = item.second; @@ -91,9 +91,7 @@ namespace big draw_list->AddLine({ esp_side_x, esp_y - (175.f * multplr) + 25.f }, { esp_side_x + (100.f * health_perc), esp_y - (175.f * multplr) + 25.f }, health_perc < 0.25f ? health_red : health_perc < 0.65f ? health_yellow : health_green, 4); } } - } } - ImGui::End(); } } \ No newline at end of file