MCPcopy Create free account
hub / github.com/SunOner/sunone_aimbot_2 / TreeNodeStoreStackData

Function TreeNodeStoreStackData

sunone_aimbot_2/imgui/imgui_widgets.cpp:7020–7040  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

7018// Store ImGuiTreeNodeStackData for just submitted node.
7019// Currently only supports 32 level deep and we are fine with (1 << Depth) overflowing into a zero, easy to increase.
7020static void TreeNodeStoreStackData(ImGuiTreeNodeFlags flags, float x1)
7021{
7022 ImGuiContext& g = *GImGui;
7023 ImGuiWindow* window = g.CurrentWindow;
7024
7025 g.TreeNodeStack.resize(g.TreeNodeStack.Size + 1);
7026 ImGuiTreeNodeStackData* tree_node_data = &g.TreeNodeStack.Data[g.TreeNodeStack.Size - 1];
7027 tree_node_data->ID = g.LastItemData.ID;
7028 tree_node_data->TreeFlags = flags;
7029 tree_node_data->ItemFlags = g.LastItemData.ItemFlags;
7030 tree_node_data->NavRect = g.LastItemData.NavRect;
7031
7032 // Initially I tried to latch value for GetColorU32(ImGuiCol_TreeLines) but it's not a good trade-off for very large trees.
7033 const bool draw_lines = (flags & (ImGuiTreeNodeFlags_DrawLinesFull | ImGuiTreeNodeFlags_DrawLinesToNodes)) != 0;
7034 tree_node_data->DrawLinesX1 = draw_lines ? (x1 + g.FontSize * 0.5f + g.Style.FramePadding.x) : +FLT_MAX;
7035 tree_node_data->DrawLinesTableColumn = (draw_lines && g.CurrentTable) ? (ImGuiTableColumnIdx)g.CurrentTable->CurrentColumn : -1;
7036 tree_node_data->DrawLinesToNodesY2 = -FLT_MAX;
7037 window->DC.TreeHasStackDataDepthMask |= (1 << window->DC.TreeDepth);
7038 if (flags & ImGuiTreeNodeFlags_DrawLinesToNodes)
7039 window->DC.TreeRecordsClippedNodesY2Mask |= (1 << window->DC.TreeDepth);
7040}
7041
7042bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end)
7043{

Callers 1

TreeNodeBehaviorMethod · 0.70

Calls 1

resizeMethod · 0.45

Tested by

no test coverage detected