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.
| 6815 | // Store ImGuiTreeNodeStackData for just submitted node. |
| 6816 | // Currently only supports 32 level deep and we are fine with (1 << Depth) overflowing into a zero, easy to increase. |
| 6817 | static void TreeNodeStoreStackData(ImGuiTreeNodeFlags flags, float x1) |
| 6818 | { |
| 6819 | ImGuiContext& g = *GImGui; |
| 6820 | ImGuiWindow* window = g.CurrentWindow; |
| 6821 | |
| 6822 | g.TreeNodeStack.resize(g.TreeNodeStack.Size + 1); |
| 6823 | ImGuiTreeNodeStackData* tree_node_data = &g.TreeNodeStack.Data[g.TreeNodeStack.Size - 1]; |
| 6824 | tree_node_data->ID = g.LastItemData.ID; |
| 6825 | tree_node_data->TreeFlags = flags; |
| 6826 | tree_node_data->ItemFlags = g.LastItemData.ItemFlags; |
| 6827 | tree_node_data->NavRect = g.LastItemData.NavRect; |
| 6828 | |
| 6829 | // Initially I tried to latch value for GetColorU32(ImGuiCol_TreeLines) but it's not a good trade-off for very large trees. |
| 6830 | const bool draw_lines = (flags & (ImGuiTreeNodeFlags_DrawLinesFull | ImGuiTreeNodeFlags_DrawLinesToNodes)) != 0; |
| 6831 | tree_node_data->DrawLinesX1 = draw_lines ? (x1 + g.FontSize * 0.5f + g.Style.FramePadding.x) : +FLT_MAX; |
| 6832 | tree_node_data->DrawLinesTableColumn = (draw_lines && g.CurrentTable) ? (ImGuiTableColumnIdx)g.CurrentTable->CurrentColumn : -1; |
| 6833 | tree_node_data->DrawLinesToNodesY2 = -FLT_MAX; |
| 6834 | window->DC.TreeHasStackDataDepthMask |= (1 << window->DC.TreeDepth); |
| 6835 | if (flags & ImGuiTreeNodeFlags_DrawLinesToNodes) |
| 6836 | window->DC.TreeRecordsClippedNodesY2Mask |= (1 << window->DC.TreeDepth); |
| 6837 | } |
| 6838 | |
| 6839 | bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end) |
| 6840 | { |
no test coverage detected