fix(PlayerList): Players rendered off-screen

Fixes #283
This commit is contained in:
Yimura 2022-06-24 23:57:52 +02:00
parent 340e743e65
commit c02dedecd7
No known key found for this signature in database
GPG Key ID: 3D8FF4397E768682

View File

@ -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 });