node editor - half links
This commit is contained in:
parent
3469a0c08b
commit
db3c06cc43
2 changed files with 10 additions and 0 deletions
1
external/imgui/imgui_user.h
vendored
1
external/imgui/imgui_user.h
vendored
|
@ -50,6 +50,7 @@ IMGUI_API void EndNodeTitleBar();
|
|||
IMGUI_API void BeginNode(ImGuiID id, ImVec2& screen_pos, bool* selected);
|
||||
IMGUI_API void EndNode();
|
||||
IMGUI_API void Pin(ImGuiID id, bool is_input, PinShape shape = PinShape::CIRCLE);
|
||||
IMGUI_API bool GetHalfLink(ImGuiID* from);
|
||||
IMGUI_API bool GetNewLink(ImGuiID* from, ImGuiID* to);
|
||||
IMGUI_API void NodeLink(ImGuiID from, ImGuiID to);
|
||||
IMGUI_API void NodeLinkEx(ImGuiID from, ImGuiID to, ImU32 color, ImU32 active_color);
|
||||
|
|
9
external/imgui/imgui_user.inl
vendored
9
external/imgui/imgui_user.inl
vendored
|
@ -124,6 +124,15 @@ namespace ImGuiEx {
|
|||
}
|
||||
}
|
||||
|
||||
bool GetHalfLink(ImGuiID* from) {
|
||||
ASSERT(g_node_editor.between_begin_end_editor);
|
||||
if (g_node_editor.new_link_from && IsMouseReleased(0) && !g_node_editor.new_link_to) {
|
||||
*from = g_node_editor.new_link_from;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetNewLink(ImGuiID* from, ImGuiID* to) {
|
||||
ASSERT(g_node_editor.between_begin_end_editor);
|
||||
if (g_node_editor.new_link_to) {
|
||||
|
|
Loading…
Reference in a new issue