MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / splitter

Function splitter

source/MaterialXGraphEditor/Graph.cpp:65–75  ·  view source on GitHub ↗

Based on the splitter function in the ImGui Node Editor blueprints-example.cpp

Source from the content-addressed store, hash-verified

63
64// Based on the splitter function in the ImGui Node Editor blueprints-example.cpp
65static bool splitter(bool split_vertically, float thickness, float* size1, float* size2, float min_size1, float min_size2, float splitter_long_axis_size = -1.0f)
66{
67 using namespace ImGui;
68 ImGuiContext& g = *GImGui;
69 ImGuiWindow* window = g.CurrentWindow;
70 ImGuiID id = window->GetID("##Splitter");
71 ImRect bb;
72 bb.Min = window->DC.CursorPos + (split_vertically ? ImVec2(*size1, 0.0f) : ImVec2(0.0f, *size1));
73 bb.Max = bb.Min + CalcItemSize(split_vertically ? ImVec2(thickness, splitter_long_axis_size) : ImVec2(splitter_long_axis_size, thickness), 0.0f, 0.0f);
74 return SplitterBehavior(bb, id, split_vertically ? ImGuiAxis_X : ImGuiAxis_Y, size1, size2, min_size1, min_size2, 0.0f);
75}
76
77// Based on showLabel from ImGui Node Editor blueprints-example.cpp
78auto showLabel = [](const char* label, ImColor color)

Callers 1

graphButtonsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected