Draw vertical line of the hierarchy
| 7182 | |
| 7183 | // Draw vertical line of the hierarchy |
| 7184 | void ImGui::TreeNodeDrawLineToTreePop(const ImGuiTreeNodeStackData* data) |
| 7185 | { |
| 7186 | ImGuiContext& g = *GImGui; |
| 7187 | ImGuiWindow* window = g.CurrentWindow; |
| 7188 | float y1 = ImMax(data->NavRect.Max.y, window->ClipRect.Min.y); |
| 7189 | float y2 = data->DrawLinesToNodesY2; |
| 7190 | if (data->TreeFlags & ImGuiTreeNodeFlags_DrawLinesFull) |
| 7191 | { |
| 7192 | float y2_full = window->DC.CursorPos.y; |
| 7193 | if (g.CurrentTable) |
| 7194 | y2_full = ImMax(g.CurrentTable->RowPosY2, y2_full); |
| 7195 | y2_full = ImTrunc(y2_full - g.Style.ItemSpacing.y - g.FontSize * 0.5f); |
| 7196 | if (y2 + (g.Style.ItemSpacing.y + g.Style.TreeLinesRounding) < y2_full) // FIXME: threshold to use ToNodes Y2 instead of Full Y2 when close by ItemSpacing.y |
| 7197 | y2 = y2_full; |
| 7198 | } |
| 7199 | y2 = ImMin(y2, window->ClipRect.Max.y); |
| 7200 | if (y2 <= y1) |
| 7201 | return; |
| 7202 | float x = ImTrunc(data->DrawLinesX1); |
| 7203 | if (data->DrawLinesTableColumn != -1) |
| 7204 | TablePushColumnChannel(data->DrawLinesTableColumn); |
| 7205 | window->DrawList->AddLineV(x, y1, y2, GetColorU32(ImGuiCol_TreeLines), g.Style.TreeLinesSize); |
| 7206 | if (data->DrawLinesTableColumn != -1) |
| 7207 | TablePopColumnChannel(); |
| 7208 | } |
| 7209 | |
| 7210 | void ImGui::TreePush(const char* str_id) |
| 7211 | { |