Store ImGuiTreeNodeStackData for just submitted node. Currently only supports 32 level deep and we are fine with (1 << Depth) overflowing into a zero, easy to increase.
| 6845 | // Store ImGuiTreeNodeStackData for just submitted node. |
| 6846 | // Currently only supports 32 level deep and we are fine with (1 << Depth) overflowing into a zero, easy to increase. |
| 6847 | static void TreeNodeStoreStackData(ImGuiTreeNodeFlags flags, float x1) |
| 6848 | { |
| 6849 | ImGuiContext& g = *GImGui; |
| 6850 | ImGuiWindow* window = g.CurrentWindow; |
| 6851 | |
| 6852 | g.TreeNodeStack.resize(g.TreeNodeStack.Size + 1); |
| 6853 | ImGuiTreeNodeStackData* tree_node_data = &g.TreeNodeStack.Data[g.TreeNodeStack.Size - 1]; |
| 6854 | tree_node_data->ID = g.LastItemData.ID; |
| 6855 | tree_node_data->TreeFlags = flags; |
| 6856 | tree_node_data->ItemFlags = g.LastItemData.ItemFlags; |
| 6857 | tree_node_data->NavRect = g.LastItemData.NavRect; |
| 6858 | |
| 6859 | // Initially I tried to latch value for GetColorU32(ImGuiCol_TreeLines) but it's not a good trade-off for very large trees. |
| 6860 | const bool draw_lines = (flags & (ImGuiTreeNodeFlags_DrawLinesFull | ImGuiTreeNodeFlags_DrawLinesToNodes)) != 0; |
| 6861 | tree_node_data->DrawLinesX1 = draw_lines ? (x1 + g.FontSize * 0.5f + g.Style.FramePadding.x) : +FLT_MAX; |
| 6862 | tree_node_data->DrawLinesTableColumn = (draw_lines && g.CurrentTable) ? (ImGuiTableColumnIdx)g.CurrentTable->CurrentColumn : -1; |
| 6863 | tree_node_data->DrawLinesToNodesY2 = -FLT_MAX; |
| 6864 | window->DC.TreeHasStackDataDepthMask |= (1 << window->DC.TreeDepth); |
| 6865 | if (flags & ImGuiTreeNodeFlags_DrawLinesToNodes) |
| 6866 | window->DC.TreeRecordsClippedNodesY2Mask |= (1 << window->DC.TreeDepth); |
| 6867 | } |
| 6868 | |
| 6869 | bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end) |
| 6870 | { |
no test coverage detected