Skip to content

Commit

Permalink
Minor touch-up on link creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Fattorino committed Feb 1, 2024
1 parent 10a65f7 commit 7936128
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/ImNodeFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ namespace ImFlow
m_dragOut = m_hovering;
if (m_dragOut)
{
ImVec2 pinDot;
if (m_dragOut->kind() == PinKind_Output)
smart_bezier(m_dragOut->pinPoint(), ImGui::GetMousePos(), m_style.colors.drag_out_link, m_style.drag_out_link_thickness);
else
Expand Down
7 changes: 2 additions & 5 deletions src/ImNodeFlow.inl
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,12 @@ namespace ImFlow
template<class T>
void InPin<T>::createLink(Pin *other)
{
if (other == this || m_parent == other->parent())
if (other == this || other->kind() == PinKind_Input || m_parent == other->parent())
return;

if (!((m_filter & other->filter()) != 0 || m_filter == ConnectionFilter_None || other->filter() == ConnectionFilter_None)) // Check Filter
return;

if (other->kind() == PinKind_Input)
return;

if (m_link && m_link->left() == other)
{
m_link.reset();
Expand Down Expand Up @@ -150,7 +147,7 @@ namespace ImFlow
template<class T>
void OutPin<T>::createLink(ImFlow::Pin *other)
{
if (other == this)
if (other == this || other->kind() == PinKind_Output)
return;

other->createLink(this);
Expand Down

0 comments on commit 7936128

Please sign in to comment.