Tables: fixed GetContentRegionAvail().y report not taking account of lower cell padding or of using ImGuiTableFlags_NoHostExtendY. (#6619)

Made GetContentRegionMax() fully defer to WorkRect when inside a table container.
This commit is contained in:
ocornut
2023-07-20 12:22:28 +02:00
parent 2bc5d17ac3
commit db66e33e9e
3 changed files with 16 additions and 6 deletions

View File

@ -9774,9 +9774,7 @@ ImVec2 ImGui::GetContentRegionMax()
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
ImVec2 mx = window->ContentRegionRect.Max;
if (window->DC.CurrentColumns || g.CurrentTable)
mx.x = window->WorkRect.Max.x;
ImVec2 mx = (window->DC.CurrentColumns || g.CurrentTable) ? window->WorkRect.Max : window->ContentRegionRect.Max;
return mx - window->Pos;
}
@ -9785,9 +9783,7 @@ ImVec2 ImGui::GetContentRegionMaxAbs()
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
ImVec2 mx = window->ContentRegionRect.Max;
if (window->DC.CurrentColumns || g.CurrentTable)
mx.x = window->WorkRect.Max.x;
ImVec2 mx = (window->DC.CurrentColumns || g.CurrentTable) ? window->WorkRect.Max : window->ContentRegionRect.Max;
return mx;
}