mirror of https://github.com/PCSX2/pcsx2.git
FSUI: Don't move IMGUI cursor unnecessarily in DrawGameGrid()
This commit is contained in:
parent
b95eb5cd74
commit
e57f7d92c3
|
@ -6224,13 +6224,23 @@ void FullscreenUI::DrawGameGrid(const ImVec2& heading_size)
|
||||||
SmallString draw_title;
|
SmallString draw_title;
|
||||||
|
|
||||||
u32 grid_x = 0;
|
u32 grid_x = 0;
|
||||||
ImGui::SetCursorPos(ImVec2(start_x, 0.0f));
|
|
||||||
for (const GameList::Entry* entry : s_game_list_sorted_entries)
|
for (const GameList::Entry* entry : s_game_list_sorted_entries)
|
||||||
{
|
{
|
||||||
ImGuiWindow* window = ImGui::GetCurrentWindow();
|
ImGuiWindow* window = ImGui::GetCurrentWindow();
|
||||||
if (window->SkipItems)
|
if (window->SkipItems)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (grid_x == grid_count_x)
|
||||||
|
{
|
||||||
|
grid_x = 0;
|
||||||
|
ImGui::SetCursorPosX(start_x);
|
||||||
|
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + item_spacing);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ImGui::SameLine(start_x + static_cast<float>(grid_x) * (item_width + item_spacing));
|
||||||
|
}
|
||||||
|
|
||||||
const ImGuiID id = window->GetID(entry->path.c_str(), entry->path.c_str() + entry->path.length());
|
const ImGuiID id = window->GetID(entry->path.c_str(), entry->path.c_str() + entry->path.length());
|
||||||
const ImVec2 pos(window->DC.CursorPos);
|
const ImVec2 pos(window->DC.CursorPos);
|
||||||
ImRect bb(pos, pos + item_size);
|
ImRect bb(pos, pos + item_size);
|
||||||
|
@ -6283,16 +6293,6 @@ void FullscreenUI::DrawGameGrid(const ImVec2& heading_size)
|
||||||
}
|
}
|
||||||
|
|
||||||
grid_x++;
|
grid_x++;
|
||||||
if (grid_x == grid_count_x)
|
|
||||||
{
|
|
||||||
grid_x = 0;
|
|
||||||
ImGui::SetCursorPosX(start_x);
|
|
||||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + item_spacing);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ImGui::SameLine(start_x + static_cast<float>(grid_x) * (item_width + item_spacing));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EndMenuButtons();
|
EndMenuButtons();
|
||||||
|
|
Loading…
Reference in New Issue