From c02dedecd7477503ce002cc4ec151f4046bf698b Mon Sep 17 00:00:00 2001 From: Yimura Date: Fri, 24 Jun 2022 23:57:52 +0200 Subject: [PATCH] fix(PlayerList): Players rendered off-screen Fixes #283 --- BigBaseV2/src/views/players/view_players.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/BigBaseV2/src/views/players/view_players.cpp b/BigBaseV2/src/views/players/view_players.cpp index d6825289..b9213aa9 100644 --- a/BigBaseV2/src/views/players/view_players.cpp +++ b/BigBaseV2/src/views/players/view_players.cpp @@ -29,11 +29,8 @@ namespace big { const auto player_count = g_player_service->players().size() + 1; - // https://github.com/ocornut/imgui/issues/4399 - float window_height = 1.f; - - window_height += (ImGui::CalcTextSize("A").y + ImGui::GetStyle().ItemInnerSpacing.y * 2 + 6.5f) * player_count; - window_height += window_pos > (float)*g_pointers->m_resolution_y - 10.f ? (float)*g_pointers->m_resolution_y - (window_pos + 40.f) : 0; + float window_height = (ImGui::CalcTextSize("A").y + ImGui::GetStyle().ItemInnerSpacing.y * 2 + 8.5f) * player_count; + window_height = window_height + window_pos > (float)*g_pointers->m_resolution_y - 10.f ? (float)*g_pointers->m_resolution_y - (window_pos + 40.f) : window_height; ImGui::PushStyleColor(ImGuiCol_FrameBg, { 0.f, 0.f, 0.f, 0.f }); ImGui::PushStyleColor(ImGuiCol_ScrollbarBg, { 0.f, 0.f, 0.f, 0.f });