TreeNode, Tables: fixed ImGuiTreeNodeFlags_DrawLinesXXX feature when TreePop() is called in table: in no column or at top of row. (#2920)

This commit is contained in:
ocornut
2025-04-10 16:26:38 +02:00
parent 5311253468
commit 8c977bf7b3
3 changed files with 12 additions and 4 deletions

View File

@@ -6919,7 +6919,10 @@ void ImGui::TreePop()
float y2 = data->DrawLinesToNodesY2;
if (data->TreeFlags & ImGuiTreeNodeFlags_DrawLinesFull)
{
float y2_full = ImTrunc(window->DC.CursorPos.y - g.Style.ItemSpacing.y - g.FontSize * 0.5f);
float y2_full = window->DC.CursorPos.y;
if (g.CurrentTable)
y2_full = ImMax(g.CurrentTable->RowPosY2, y2_full);
y2_full = ImTrunc(y2_full - g.Style.ItemSpacing.y - g.FontSize * 0.5f);
if (y2 + g.Style.ItemSpacing.y < y2_full) // FIXME: threshold to use ToNodes Y2 instead of Full Y2 when close by ItemSpacing.y
y2 = y2_full;
}