Skip to content

Commit

Permalink
feat(GraphView): draw variable-to-ref wires a little transparent
Browse files Browse the repository at this point in the history
  • Loading branch information
berdal84 committed Oct 25, 2024
1 parent faa224f commit 989e4d0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/ndbl/gui/GraphView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,6 @@ bool GraphView::draw()
if ( !node_view_in->visible() )
continue;

// Skip variable--->ref wires in certain cases
if (node_out->type() == NodeType_VARIABLE ) // from a variable
{
auto variable = static_cast<VariableNode*>( node_out );
if (slot_out == variable->ref_out() ) // from a reference slot (can't be a declaration link)
if (!node_view_out->selected() && !node_view_in->selected() )
continue;
}

Vec2 p1, cp1, cp2, p2; // BezierCurveSegment's points

SlotView* slot_view_out = slot_out->view;
Expand Down Expand Up @@ -280,6 +271,15 @@ bool GraphView::draw()
style.shadow_color = Vec4::lerp(style.shadow_color, Vec4(0, 0, 0, 0), factor);
}

// Draw transparent some "variable--->ref" wires in certain cases
if (node_out->type() == NodeType_VARIABLE ) // from a variable
{
auto variable = static_cast<VariableNode*>( node_out );
if (slot_out == variable->ref_out() ) // from a reference slot (can't be a declaration link)
if (!node_view_out->selected() && !node_view_in->selected() )
style.color.w *= 0.25f;
}

// draw the wire if necessary
if (style.color.w != 0.f)
{
Expand Down

0 comments on commit 989e4d0

Please sign in to comment.